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.

Answers were Sorted based on User's Feedback



wap to print "hello world" without using the main function...

Answer / sivasankar

#include<stdio.h>
#include<conio.h>
#define ksrct main()
ksrct
{
clrscr();
printf("hello world");
getch();
}

Is This Answer Correct ?    1 Yes 1 No

wap to print "hello world" without using the main function...

Answer / vaibhav

@Deepika some correction:

#include<stdio.h>
#define decode(s,t,u,m,p,e,d) m##s##u##t
#define begin decode(a,n,i,m,a,t,e)
int begin()
{
printf("Hello World");
}

Is This Answer Correct ?    0 Yes 1 No

wap to print "hello world" without using the main function...

Answer / 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

wap to print "hello world" without using the main function...

Answer / siva

#include<stdio.h>
#include<conio.h>
#define siva main
siva()
{
clrscr();
printf("hello world");
getch();
return 0;
}

Is This Answer Correct ?    3 Yes 5 No

wap to print "hello world" without using the main function...

Answer / vignesh1988i

the basic format or the first executable code line is the
main function in C.... so if we try to print the anything
without main we are trying to modify the basic concepts of C
and this will not look nice....

thank u

Is This Answer Correct ?    20 Yes 24 No

wap to print "hello world" without using the main function...

Answer / kk

And some deserts for Mr. Vignesh1988i ..
For your kind attention sir.. Method main() is not the first
line in any executable... Have you ever heard of
initialization??
Yes you can say what ever the developer writes in any
program starts in main()..

Is This Answer Correct ?    3 Yes 11 No

wap to print "hello world" without using the main function...

Answer / abhradeep chatterjee

its not possible.

Is This Answer Correct ?    11 Yes 19 No

wap to print "hello world" without using the main function...

Answer / goutam kumar das

the question is wrong

Is This Answer Correct ?    0 Yes 10 No

wap to print "hello world" without using the main function...

Answer / kk

main() method is the entry point for any c/c++ program which
is compiled/linked as executable. C/C++ does not force
anyone to use only main() method as the entry point. This is
only the default behavior and can be changed. This is
generally slightly different for different compiler. But you
can do this.. Simply define any other method say noMe() to
be the entry point for the executable.
Who the hell uses main()to do main stuffs in any
executable.. It should have been called something like
start() ot begin().. :)

Well this is not the answer.. Just little guidance..

Is This Answer Correct ?    3 Yes 16 No

wap to print "hello world" without using the main function...

Answer / thirupathi reddy

by using the comment lines we can get the output

Is This Answer Correct ?    7 Yes 35 No

Post New Answer

More C Interview Questions

What is volatile

2 Answers  


print the pattern 1 2 4 3 6 9 4 8 12 16 5 10 15 20 25 if n=5

3 Answers   Winit,


What is structure padding ?

3 Answers   HP,


How can you pass an array to a function by value?

0 Answers  


difference between my-strcpy and strcpy ?

3 Answers   Geometric Software, IIM, Infosys,


What is a macro in c preprocessor?

0 Answers  


Write a program to print the following series 2 5 11 17 23 31 41 47 59 ...

2 Answers  


Which built-in library function can be used to match a patter from the string?

0 Answers  


A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?

0 Answers  


Heyyy All, Just a challenge . A C program with if Else if(){ /// insert sumthing print ("in if") // insert sumting } else { ///// insert sumthing print ("in else"); //// insert sumthing } can anyone modify it so that program prints. if and else both

3 Answers  


Give differences between - new and malloc() , delete and free() ?

0 Answers   Genpact,


How can I delete a file?

0 Answers  


Categories