0 like 0 dislike
56 views
in Computer Science by (1.0m points)
What is the purpose of main function?

1 Answer

0 like 0 dislike
by (1.0m points)
In C, program execution starts from the main() function. Every C program must contain a main() function. The main function may contain any number of statements. These statements are executed sequentially in the order which they are written.

The main function can in-turn call other functions. When main calls a function, it passes the execution control to that function. The function returns control to main when a return statement is executed or when end of function is reached.

In C, the function prototype of the 'main' is one of the following:

int main(); //main with no arguments

Related questions

0 like 0 dislike
1 answer 30 views
asked Feb 13, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 59 views
asked Nov 9, 2018 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 47 views
asked Nov 9, 2018 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 53 views
asked Nov 9, 2018 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 28 views
asked Nov 9, 2018 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 35 views
0 like 0 dislike
1 answer 33 views
0 like 0 dislike
1 answer 151 views
0 like 0 dislike
1 answer 67 views
asked Apr 3, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 42 views
asked Feb 14, 2019 in Computer Science by danish (1.0m points)
Welcome to Free Homework Help, where you can ask questions and receive answers from other members of the community. Anybody can ask a question. Anybody can answer. The best answers are voted up and rise to the top. Join them; it only takes a minute: School, College, University, Academy Free Homework Help

19.4k questions

18.3k answers

8.7k comments

4.1k users

Free Hit Counters
...