In C and C++ Main function doesn't return any value then why we prefer it's return type as int? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

In C and C++ Main function doesn't return any value then why we prefer it's return type as int?

why int datatype is more preferable than void?

19th Jun 2018, 5:47 PM
Bhautik Donga
Bhautik Donga - avatar
3 Answers
+ 1
Bhautik Donga which language?. Java, c# C or C++ ?
19th Jun 2018, 6:42 PM
Dlite
Dlite - avatar
+ 1
In c and c++
20th Jun 2018, 2:37 AM
Bhautik Donga
Bhautik Donga - avatar
+ 1
It returns 0. don't forget
20th Jun 2018, 4:08 AM
Dlite
Dlite - avatar