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

When should the volatile modifier be used?

0 Answers  


Explain bitwise shift operators?

0 Answers  


An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above

0 Answers  


wite a programme in c to linear search a data using flag and without using flags?

3 Answers   TCS,


Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

0 Answers  






Write a program to print ASCII code for a given digit.

0 Answers   EXL, HCL,


How can a process change an environment variable in its caller?

0 Answers  


input any 4 digit number and find the difference of all the digits?

3 Answers   Google,


12345 1234 123 12 1

2 Answers  


Write a program to generate prime factors of a given integer?

2 Answers  


Determine if a number is a power of 2 at O(1).

2 Answers  


what is the advantage of function pointer

16 Answers   CMC, CS, Freshdesk, L&T, LG Soft, Matrix, TCS,


Categories