Find out the errors in the following :
void product (void)
{
int a, b, c ,result;
printf( “Enter three integers : “)
scanf(“°/od %d %d” ,&a ,&b ,&c );
result = a*b*c
printf( “Result is °/od” , result);
return result;
}
Answers
Answered by
0
Hii dear here is your answer
option b is the correct answer
Hope it's help u
option b is the correct answer
Hope it's help u
Answered by
0
Errors in the program:
void product (void)
{
int a, b, c ,result;
printf( “Enter three integers : “)
scanf(“°/od %d %d” ,&a ,&b ,&c );
result = a*b*c
printf( “Result is °/od” , result);
return result;
}
In the” scanf statement”, the first percentaile is not properly placed. The next error is in the same line, where there is no comma between “%d, %d, %d” which might lead to one another error. The next statement where the value of a, b, c is multiplied and stored in the variable “result” needs semicolon.
The same error of “%d” is repeated in “printf statement”. The return type of the function is “void” but the function actually returns “result”. So the return type of the function to be changed to “int”.
Similar questions
English,
7 months ago
Hindi,
7 months ago
English,
1 year ago
Science,
1 year ago
Social Sciences,
1 year ago