0
Why we use ' endl ' at the end of every cout statement and return 0 at end of program
2 Answers
+ 2
endl isnt necesarry to be there, what it does is output a newline character the flush the output.
Return 0 is part of standard, remember the function lesson where the function can return a data with type stated at function declaration. same with main function (int main()) it should return a value in int after the function.
Why do we need it ? It simply tell if the program working correctly or not, if the value returned are 0, that means nothing is wrong.
0
Thanks