Gangadhari
asked

Expert
Sarthak Baral answered
Hi Gangadhari,
In C, you should use int main() because main is supposed to return an integer status code to the operating system.
Example:
int main() {
return 0;
}
void main() is not standard C, so it is best to avoid it.
If you have more questions, I am here to help π
C
This question was asked as part of the Learn C Programming course.
Our Experts
Sudip BhandariHead of Growth/Marketing
Apekchhya ShresthaSenior Product Manager
Kelish RaiTechnical Content Writer
Abhilekh GautamSystem Engineer
Palistha SinghTechnical Content Writer
Sarthak BaralSenior Content Editor
Saujanya Poudel
Abhay Jajodia
Nisha SharmaTechnical Content Writer
Udayan ShakyaTechnical Content Writer
