+ 1
It is giving right output but also giving error why ?
2 Answers
+ 2
void main is no longer supportable in c /cpp you can use int main with return 0 or return EXIT_SUCCESS
+ 1
hi Abhay
not an error, it's just a warning, and you can run out of it by adding: #pragma GCC diagnostic ignored "-Wmain"
this allows you to selectively enable or disable certain types of diagnostics, *or* simply you can just change the return type of the main function to int instead of void just like Raghuvanshi said..