C语言程序阅读题

来源:百度知道 编辑:UC知道 时间:2024/05/21 12:05:07
1.
#include <stdio.h>
main()
{ int a=1,b=3,c=5;
if (c==a+b)
printf("yes\n");
else
printf("no\n");
}
运行结果为:

2.
#include <stdio.h>
main()
{ int a=12, b= -34, c=56, min=0;
min=a;
if(min>b)
min=b;
if(min>c)
min=c;
printf("min=%d", min);
}
运行结果为:

3.
#include <stdio.h>
main()
{ int x=2,y= -1,z=5;
if(x<y)
if(y<0)
z=0;
else
z=z+1;
printf(“%d\n”,z);
}
运行结果为:

4.
#include <stdio.h>
main()
{int a=10,b=50,c=30;
if(a>b)
a=b;
b=c;
c=a;
printf("a=%d b=%d c=%d\n",a,b,c);
}
运行结果为:

5.
#include <stdio.h>
main()
{ float a,b,c,t;
a=3;
b=7;
c=1;
if(a>b)
{t=a;a=b;b=t;}
if(a>c)
{t=a;

本人随意口算。可能有错。
若有错请原谅。
谢谢。
1
no
2.
min=-34
3.
1
4.
10,30,10
5.
3.00 1.00 7.00
6.
result is 12.48
7.
NO
8.
7.0
9.
d=25
10.
1
over!
11.
-9 is anegaive odd
12.
1,0,7
13.
32,28,20
14.
3

经过TC验证
no
-34
5
a=10 b=30 c=10
1.00, 3.00, 7.00
result is12.480000
NO
7.0
d=20
over!
-9 is a negative odd
1,0,7
32,28,30
14题:
1
2
3