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


Please Help Members By Posting Answers For Below Questions

Can we use visual studio for c?

540


What are the types of assignment statements?

622


What is pointer to pointer in c language?

585


Can the curly brackets { } be used to enclose a single line of code?

707


What is a stream water?

645






Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

556


what is use of malloc and calloc?

1374


What are the advantages and disadvantages of a heap?

697


Explain threaded binary trees?

670


What is d'n in c?

624


What is the use of function in c?

702


What is indirection in c?

615


Write a C program in Fibonacci series.

622


Why C language is a procedural language?

613


Explain how can I prevent another program from modifying part of a file that I am modifying?

630