+ 1
what does int mean in the main function in c++
int main()
2 Answers
+ 1
It means it returns an integer (a whole number)
That's why you have to write "return 0;" in the end.
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);
....
...
}