+ 1
why do we have to end with return 0
can't we use getch
3 Answers
0
0 stands for system code - programm finished without errors.
0
it is just a convention to return 0 because 0 is nothing in cpp so if there are not any errors u get nothing, and we have to return something in this case an integer because the return type of our main function is int
0
it is not necessary if we use void instead of int at the main statement then no return is required for int we have to return any value to compiler. and getch is used for wait command to compiler and to continue new line command means enter is needed