#include <stdio.h>
int higher_num(int x, int y);
int main()
{
int x, y;
printf("Enter an integer: ");
scanf("%d", &x);
printf("Enter another integer: ");
scanf("%d", &y);
printf("The higher number is %f\n", higher_num(x, y));
return(0);
}
int
higher_num(int x, int y)
{
return( if (x > y)
printf("%f\n", x);
else
printf("%f\n", y);
)
}
ok... i dunno where im going wrong.
the question is: Write a program with a function (give it a meaningful name) that takes as parameters two integers and prints the larger integer with a meaningful message. In main, use scanf to get two integers from the user and pass them to your new function. Hint: test the function by calling it from main on two integer constants - after you know it works correctly, add the scanfs.
i think i have it right.. but apparently its wrong..

New Topic/Question
Reply




MultiQuote









|