wap to print "hello world" without using the main function.
Answer Posted / ranjan
#include<stdio.h>
#include<iostream.h>
class World
{
public:
World()
{
printf("Hello world");
}
}
world w1;
Here the object is declared globaly.so when the object is
defined it will call the constructor of that & that will
display the "hello world". no need to write main. as it is
global.
| Is This Answer Correct ? | 2 Yes | 4 No |
Post New Answer View All Answers
Why void is used in c?
What is a node in c?
Does c have circular shift operators?
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
Can an array be an Ivalue?
What are void pointers in c?
Can the “if” function be used in comparing strings?
What are the 4 types of organizational structures?
Differentiate between functions getch() and getche().
What are the types of assignment statements?
Explain how can you tell whether two strings are the same?
What is s or c?
Can you please explain the difference between strcpy() and memcpy() function?
How can I do peek and poke in c?
How can I make it pause before closing the program output window?