Void main ()
{
Int a, [10].
Int the sum (int [b]);
Printf (" input the number 10: \ n ");
for(int i=0; I<10; I++)
{
The scanf (" % d ", & amp; A [I]);
}
Printf (" the even and=% d ", sum);
}
Int the sum (int [b])
{
Int I, temp=0;
for(i=0; i<10; I++)
{
If (b [I] % 2==0)
+=b \ [I];
}
Return temp.
I this program to perform an array of the even and, don't know why the results have been wrong, is I have a problem with the parameters of the printf sum of
}
CodePudding user response:
Because there is no incoming parameters, the sum is only print the sum function addressCodePudding user response:
Printf (" even and=% d ", sum);To printf (" the even and=% d ", sum (a));
CodePudding user response:
Printf (" the even and=% d ", sum);You this sentence is to want to call a function sum, a function call you have to use this format: the function name (function argument)
CodePudding user response: