Main must be written asa.the first function in the programb.Second function in the programc.Last function in the programd.any where in the program

C
This question is related to TCS Interview

Showing Answers 1 - 37 of 37 Answers

brijesh jain

  • Aug 17th, 2005
 

The answer can be option D. 
 
Main can be written anywhere in C program.

Sinic

  • Aug 23rd, 2005
 

It's not sensitive the position of the Main function in C program so answer is D

rp

  • Aug 25th, 2005
 

answer is D 
where ever be the main,execution starts from there. so no problem 

MAHAVEER PATIL

  • Feb 3rd, 2006
 

second function in the programme

  Was this answer useful?  Yes

ratnakar

  • Apr 5th, 2006
 

In C there are no function declarations

only definitions so main is the last in the program.

  Was this answer useful?  Yes

GOKILA

  • Apr 23rd, 2006
 

hey, main() can be written anywhere in the program

saravanan

  • Feb 23rd, 2007
 

main() function can be written anywhere in the pgm but it should be include in the pgm

poojadev

  • Mar 3rd, 2009
 

Answer is d
It can be written any where in the program
Considering that it should not be written inside another function - since it includes the co-functions inside it, whenever a function is called.

  Was this answer useful?  Yes

anon1987

  • Dec 7th, 2009
 

This must be C last funtion of the code because any function which I defined after main() will not be able to find by the compiler.

Ans ::: -- C

  Was this answer useful?  Yes

sami_sharma

  • Dec 16th, 2010
 

Last function of program. If we use it any where than it is necessary that declartion of other function used in programe must be after main() function.

  Was this answer useful?  Yes

You Can write main function anywhere in the program..
But it is necessary to write main function in the program. position doesn't matter.
You can even call main function in any program in itself also.

  Was this answer useful?  Yes

HEMA

  • Sep 3rd, 2011
 

D. Any where in the program. - During compilation it goes directly go to main function.

  Was this answer useful?  Yes

MEGHA GUPTA

  • Sep 11th, 2011
 

(d) Anywhere in the program

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions