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

Why void is used in c?

951


What is a node in c?

919


Does c have circular shift operators?

1183


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?

1170


Can an array be an Ivalue?

1055


What are void pointers in c?

966


Can the “if” function be used in comparing strings?

982


What are the 4 types of organizational structures?

1031


Differentiate between functions getch() and getche().

988


What are the types of assignment statements?

1006


Explain how can you tell whether two strings are the same?

971


What is s or c?

1014


Can you please explain the difference between strcpy() and memcpy() function?

1015


How can I do peek and poke in c?

1038


How can I make it pause before closing the program output window?

990