Hello
why do we use return 0; at end of program and when do we need of return 0; in program.?
while searching I found that main function of type int therefore it should be return integer value. but I don't understand why it should be 0, it may be any value 1, 2, 3...etc
I have compiled both programs with return 0, and without return 0; but result is same . it display same message .
Program with return 0;
Result All about circuit forum
program without return 0;
Result All about circuit forum
why do we use return 0; at end of program and when do we need of return 0; in program.?
while searching I found that main function of type int therefore it should be return integer value. but I don't understand why it should be 0, it may be any value 1, 2, 3...etc
I have compiled both programs with return 0, and without return 0; but result is same . it display same message .
Program with return 0;
Code:
#include <stdio.h> // header file //
int main(void) //start main program//
{
printf("All about circuit forum"); // print message//
return 0;
}
program without return 0;
Code:
#include <stdio.h> // header file //
int main(void) //start main program//
{
printf("All about circuit forum"); // print message//
}