Can more than one main() exist in the same program??

Questions by rekhaty

Showing Answers 1 - 12 of 12 Answers

Gagandeep Singh

  • Jun 3rd, 2012
 

No, A Program can have exactly one main. As this is the only function from where the compiler assures that the execution of program should begin.

agila

  • Jul 6th, 2012
 

No,there is only one main function.Main function is to indicate the whole calculation part of a program that is the process begin.

Ashok Kumar Orupalli

  • Sep 4th, 2012
 

Only one main main function is allowed. But you can call that main function n number of times.

Code
  1. void main()

  2. {

  3.     static int a;;

  4.     printf("%d",a);

  5.     printf(main());

  6. }

dhruv

  • Sep 25th, 2012
 

yes, it is called recursion

  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