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 language ?
What is the explanation for prototype function in c?
Explain enumerated types in c language?
Why does this code crash?
What is the purpose of type declarations?
What are two dimensional arrays alternatively called as?
Why doesnt this code work?
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
how is the examination pattern?
What is #line?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
I need a sort of an approximate strcmp routine?
Is c is a procedural language?
What is a volatile keyword in c?