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 isn't any of this standardized in c? Any real program has to do some of these things.
In which layer of the network datastructure format change is done
What is the use of f in c?
What is extern variable in c with example?
What is an identifier?
What is typedef struct in c?
What is %d used for?
if p is a string contained in a string?
Differentiate between Macro and ordinary definition.
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
What are the keywords in c?
How can you access memory located at a certain address?
What is a stream in c programming?
Is it valid to address one element beyond the end of an array?
How do you define a string?