#include<stdio.h>
int main()
{
int num1,num2,num3;
//Ask user to input any three integer numbers
printf("\nEnter value of num1, num2 and num3:");
//Store input values in variables for comparsion
scanf("%d %d %d",&num1,&num2,&num3);
if((num1>num2)&&(num1>num3))
printf("\n Number1 is greatest");
else if((num2>num3)&&(num2>num1))
printf("\n Number2 is greatest");
else
printf("\n Number3 is greatest");
return 0;
}
对三个数仙相互比较,给出最大数。
结果
Enter value of num1, num2 and num3:789 345 1234
Number3 is greatest
除教程外,本网站大部分文章来自互联网,如果有内容冒犯到你,请联系我们删除!