Question:
What is the purpose of main( ) function?
Answer:
main() is the user defined function.
main() is the first function in the program which gets called when the program executes.The startup code contains runmain() function which calls main() function.we can't chage the name of the main() function. Source: CoolInterview.com
main() is the user defined function . the program execution is always started from main. it is not possible to write the program without main() Source: CoolInterview.com
Answered by: sreelatha | Date:
| Contact sreelatha
For C language when the host call a program the address of main is stored and as soon as we give return 0,this is an indication to the host that the program terminated normally.Hence main internally do some system calls to execute the program and returns 0 as it terminate normally or give any number other than ZERO to give signal to the host that it terminated abnormally. Source: CoolInterview.com
Answered by: Retheesh G | Date: 9/9/2007 4:52:08 AM
| Contact Retheesh G
main() is a special function used by c program to tell the compiler where program starts and where the program ends.every c program must consist of one main() function.
if you use more than one main(),the compiler doesn't know which one indicate starting of c program. Source: CoolInterview.com
Answered by: uppala mamatha | Date: 1/23/2008
| Contact uppala mamatha
main() is a special function used by c program to tell the compiler where program starts and where the program ends.Every c program must consist of one main() function.
If you use more than one main(),the compiler doesn't know which one indicate starting of c program. Source: CoolInterview.com
Answered by: uppala mamatha | Date: 1/23/2008
| Contact uppala mamatha
main is user define function i.e define by the user and declaration by the Operating system and call by the Operating system.In C language every program compile beginning of the line and run start the main() function. Source: CoolInterview.com
Answered by: prem kumar | Date: 7/15/2008
| Contact prem kumar
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|