点击蓝字
关注我们
1-1double f = 2.5e5;
printf ("f=%5.4lf\n", f);
The output will be
f=250000.0000
T
1-2int a,b;
scanf("a=%d,b=%d",&a,&b);
the correct input should be: 5,6
F
1-3语句printf("%.2f",1.0/3);输出为0.33。
T
1-4
C语言中不能用scanf 函数输入字符。
F
1-5C语言中不能用printf函数输出字符。
F
1-6执行以下程序段后,输出i = 10, j = 20。
int i, j;
i = 10;
j = 20;
printf("i = %d, j = %d", j, i);
F
1-7执行以下程序段,输入10,输出10.00。
double x;
scanf("%d", &x);
printf("%.2f", x); F
1-8执行以下程序段,输入20,输出20.00。
double x;
scanf("%f", &x);
printf("%.2f", x); F
1-9执行以下程序段,输入30,输出30.00。
double x;
scanf("x=%lf", &x);
printf("%.2f", x); F
1-10执行以下程序段,输入1000 3 0.025,输出1000#3#0.025。
int money, year;
double rate;
scanf("%d %d %lf", &money, &year, &rate);
printf("%d#%d#%.3f", money, year, rate); T
1-11执行以下程序段,输入1001 3 0.025,输出1001#3#0.025。
int money, year;
double rate;
scanf("%d %lf %d ", &money, &year, &rate);
printf("%d#%d#%.3f", money, year, rate);
F
1-12执行以下程序段,输入1002 0.025 3,输出1002#3#0.025。
int money, year;
double rate;
scanf("%d%lf%d", &money, &rate, &year);
printf("%d#%d#%.3f", money, year, rate); T
1-13执行以下程序段,输入1003 3 0.025,输出1003#3#0.025。
int money, year;
double rate;
scanf("%d %d %lf", &money, &year);
printf("%d#%d#%.3f", money, year, rate);
F
1-14C语言中不能用printf函数输出字符。
F
1-15C语言中不能用scanf函数输入字符。
F
1-16执行语句putchar('S');后,在屏幕上显示的输出结果是'S'。
F
1-17设变量已正确定义,执行以下程序段,顺序输入三个字符'Q',则输出Q。
F
ch = getchar();
putchar(ch);
1-18设变量已正确定义,执行以下程序段,顺序输入三个字符'k',则输出k。
T
scanf(“%c%c%c”, &ch1, &ch2, &ch3);
printf(“%c”, ch2);
1-19若表达式sizeof(int)的值为4,则int类型数据可以表示的最大整数为231−1。
T
1-20
下面这段代码,用%d格式打印输出double型变量,将会进行取整,输出为3。
T
#include
int main(){
double pi = 3.14159;
printf("%d", pi);
return 0;
}
1-21下面这段代码,用%.2f格式打印输出int型变量,将会输出2019.00。
F
#include
int main(){
int k