【发布时间】:2021-10-06 12:48:45
【问题描述】:
所以基本上我写了这段代码来打印更大的数字,但它不起作用。我是 C 新手,这让我很困惑
#include <stdio.h>
int greater(int a, int b);
int main()
{
int a,b,x;
printf("\n Enter two numbers:");
scanf("%d %d ",&a, &b);
x=greater(a, b);
printf("\n The greatest number is:%d", x);
return 0;
}
int greater(int x, int y)
{ int great;
if(x>y){
great=x;
}
else
{
great=y;
}
return great;
}```
【问题讨论】: