Int main()=why always right int with main(). what does it mean

why always right int with main(). what does it mean

@Pavan0001
main is a function like any other so it has to have a return type.
A lot of programmers used to use void main( ) in programming and it worked until C++ standards made it compulsory to use int main( ).
The reason is simple. If you run the program , the return value returned by the main( ) is used an exit code for the program and is thus essential. We generally return 0 from main( ) to show success.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.