+ 2

why int main() is declared at the beginning of program ?

int describes a integer, that if we are including an integer we have to include "int" but why we have to include int at the beginning of the program ??

6th Feb 2019, 4:44 PM
Pilli Revant Krishna Sagar
Pilli Revant Krishna Sagar - avatar
6 Respostas
+ 2
Please delete your duplicate post. Check out the last paragraph of the second page of the link. https://www.sololearn.com/learn/C/2911/?ref=app
6th Feb 2019, 6:09 PM
Lambda_Driver
Lambda_Driver - avatar
+ 2
return 0; This statement terminates the main() function and returns the value 0 to the calling process. The number 0 generally means that our program has successfully executed. Any other number indicates that the program has failed.
9th Feb 2019, 2:28 PM
Lambda_Driver
Lambda_Driver - avatar
+ 2
Since the code says int main(), you have to return an int. If the program returns the value 0, then the program has no issues. Otherwise, something went wrong.
9th Feb 2019, 2:30 PM
Lambda_Driver
Lambda_Driver - avatar
+ 1
ohhh
9th Feb 2019, 2:34 PM
Pilli Revant Krishna Sagar
Pilli Revant Krishna Sagar - avatar
+ 1
kkk i get it !!! thank you bro....
9th Feb 2019, 2:35 PM
Pilli Revant Krishna Sagar
Pilli Revant Krishna Sagar - avatar
0
i understood about the main() but what about the "int"
9th Feb 2019, 2:26 PM
Pilli Revant Krishna Sagar
Pilli Revant Krishna Sagar - avatar