0
what is wrong with this program
int function1 (int n) { cout << n; } function2 (int n, m) { n += m; function (3.4); }
4 Answers
+ 1
int function1 (int n)
{
cout << n;
}
function2 (int n, int m)
{
n += m;
function1 (3); // why here float as for function1 accepts int
}
0
parameter declaration in function should be done individually.
function2 (int n, m) is wrong
function2 (int n, int m) is right way of declaration.
0
one more mistake is in function call; it should be comma instead of full stop.
0
1) the way you declared your parameters is wrong. you MUST state the data type & identifier.
2) you have it returning a float instead of and int (integer) value
that's all, as far as I can see