+ 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 Réponses
+ 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