+ 1

[DUPLICATE] Why do we use return in C if we use int

C

8th Jan 2018, 2:43 PM
Sathya
Sathya - avatar
2 Answers
+ 11
In C and C++ programs the main function is of type int and therefore it should return an integer value. The return value of the main function is considered the "Exit Status" of the application. On most operating systems returning 0 is a success status like saying "The program worked fine".
8th Jan 2018, 2:49 PM
GAWEN STEASY
GAWEN STEASY - avatar