wap to print "hello world" without using the main function.
Answer Posted / andy
Ranjan's answer was the correct one. And it's what interviewers expect.
use g++ to compile and run this:
#include<stdio.h>
#include<iostream>
class World
{
public:
World()
{
printf("Hello world\n");
}
};
World w1;
int main()
{
printf("Hello world again!!\n");
return 0;
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is c token?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What is indirection? How many levels of pointers can you have?
Why isnt there a numbered, multi-level break statement to break out
Do pointers need to be initialized?
What is malloc() function?
What does sizeof function do?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
What type of function is main ()?
Is c procedural or functional?
What is string in c language?
Is flag a keyword in c?
Why is a semicolon (;) put at the end of every program statement?
What is anagram in c?
What is wrong with this code?