if program coded without return 0 what difference happend in output screen? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
- 3

if program coded without return 0 what difference happend in output screen?

11th Aug 2020, 2:17 PM
MAGESH T K
4 ответов
+ 3
Both in c and c++ return 0 is optional. Also MAGESH T K use appropriate tag and include the language tag next time.
11th Aug 2020, 3:14 PM
The future is now thanks to science
The future is now thanks to science - avatar
+ 1
Nothing
11th Aug 2020, 2:29 PM
Namit Jain
Namit Jain - avatar
0
In c ,u need to use it since main function requires it or else error might come (maybe) In c++ it's optional since compiler automatically adds return 0;
11th Aug 2020, 2:31 PM
Prasad Bankar
Prasad Bankar - avatar
0
If we're talking C++ then most compilers will automatically handle no returns on your main function by automatically returning 0, so there's no real difference unless you manually return something different. Unless your compiler is really bad and errors when there's no return in the main function.
11th Aug 2020, 9:12 PM
0x90
0x90 - avatar