int multiply(int a, char *b) {
return a b;
}
//this code does not execute properly why?/find out?
Answers
Answered by
0
Answer:
it should bereturn a*b. if I am wrong then message then I will try again
Answered by
2
The code does not work for the following reason:
“multiply” is a user defined function which takes two argument an integer and a character pointer. The problem is with the return statement. As per the function signature the method “multiply” has to return a single integer. But in this code the programmer tries to return more than one value. Also the variable a matches with the return type of integer but the variable b does not match.
Similar questions