题目内容

有如下程序,写出该执行结果( )。#include ”stdio.h”main(){float x=2.0, y;if (x<0.0) y=0.0;else if (x<10.0) y=1.0/x;else y=1.0;printf(”%f\n”,y);}

A. 0.000000
B. 0.250000
C. 0.500000
D. 1.000000

查看答案
更多问题

有以下程序,程序运行后的输出结果是()。#include ”stdio.h”main(){int a=15, b=21, m=0;switch (a%3){ case 0: m++; break;case 1: m++;switch (b%2){ default: m++;case 0: m++; break;}}printf(”%d\n”,m);}

A. 1
B. 2
C. 3
D. 4

若有如下说明和语句int i=3,j; .j=(i++)+(++i)+(++i);执行后i=______,j=________。

若有如下说明和语句int i=3,j;j=++i+((i++)+i+(++i))+i++;执行后i=_______,j=_________。

若从键盘输入58,则输出结果是________。#include ”stdio.h”main(){int a;scanf(”%d”, &a);if (a>50) printf(”%d”, a);if (a>40) printf(”%d”,a);if (a>30) printf(”%d”,a);}

答案查题题库