what does int mean in the main function in c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what does int mean in the main function in c++

int main()

7th Aug 2018, 7:06 AM
Christopher Katambo
Christopher Katambo - avatar
2 Answers
+ 1
It means it returns an integer (a whole number) That's why you have to write "return 0;" in the end.
7th Aug 2018, 7:51 AM
ReimarPB
ReimarPB - avatar
0
Here function named sum is returning integer value so you have to use int. Example : int sum(int a,int b) { int c = a+b; return c; } int main() { .... ... int d = sum(1,2); printf("%d", d); .... ... }
7th Aug 2018, 8:35 AM
Meet Mehta
Meet Mehta - avatar