Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is getch() function?

1055


Dont ansi function prototypes render lint obsolete?

1124


what are enumerations in C

1161


What is the difference between malloc calloc and realloc in c?

1143


What is uint8 in c?

1102


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

1243


Is there any demerits of using pointer?

1070


Write a program which returns the first non repetitive character in the string?

1123


#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); }

1280


Is fortran still used today?

1090


What is difference between structure and union?

1126


What are the different types of control structures?

1043


Is c easy to learn?

979


When a c file is executed there are many files that are automatically opened what are they files?

1107


Explain the difference between #include "..." And #include <...> In c?

1024