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
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
Explain what is the benefit of using enum to declare a constant?
Explain what is a stream?
How does free() know explain how much memory to release?
Tell me is null always defined as 0(zero)?
What is nested structure with example?
Can we use any name in place of argv and argc as command line arguments?
How many levels of pointers can you have?
What is malloc and calloc?
What is auto keyword in c?
What are the 5 types of organizational structures?
How can you allocate arrays or structures bigger than 64K?
What does node * mean?
What is %g in c?
Is r written in c?