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 are local static variables? How can you use them?
What is calloc in c?
What’s the special use of UNIONS?
What is the difference between char array and char pointer?
How can you invoke another program from within a C program?
Between macros and functions,which is better to use and why?
What are the application of c?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
Explain the difference between ++u and u++?
code for replace tabs with equivalent number of blanks
How can I pad a string to a known length?
What do you mean by invalid pointer arithmetic?
Explain how can I write functions that take a variable number of arguments?
What does it mean when a pointer is used in an if statement?
What is class and object in c?