Question: I keep getting an error for the last line. error: expected declaration or statement at end of input #include int main(void) { double average(int x,

I keep getting an error for the last line. error: expected declaration or statement at end of input

#include

int main(void) { double average(int x, int y);

int main(void){ int x, y;

double result;

printf("Enter first integer:"); scanf("%d", &x); printf("Enter second integer:"); scanf("%d", &y);

result=average(x,y);

printf("Average=%f",result);

return 0;

double average(int x, int y){ return (x + y)/2.0;} }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!