在三个数字中找到最大数字的C程序
该程序采用3个数字,并在所有数字中找到最大的数字。为此,我们将相互比较数字,找出最大的数字
Input: a=2,b=4,c=7 Output:7 Largest Number
说明
该程序仅使用if语句查找最大数目。
示例
#include <iostream>
using namespace std;
int main() {
int a,b,c;
a=2,b=4,c=7;
if(a>b) {
if(a>c) {
printf("%d Largest Number ",a);
} else {
printf("%d Largest Number ",c);
}
} else {
if(b>c) {
printf("%d Largest Number ",b);
} else {
printf("%d Largest Number ",c);
}
}
return 0;
}热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短