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 getch() function?
Dont ansi function prototypes render lint obsolete?
what are enumerations in C
What is the difference between malloc calloc and realloc in c?
What is uint8 in c?
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
Is there any demerits of using pointer?
Write a program which returns the first non repetitive character in the string?
#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }
Is fortran still used today?
What is difference between structure and union?
What are the different types of control structures?
Is c easy to learn?
When a c file is executed there are many files that are automatically opened what are they files?
Explain the difference between #include "..." And #include <...> In c?