若执行下述程序时,从键盘输入的数据是3和6,则程序的输出结果是( )。 #include <stdio.h> void main() {int x,y,z; scanf("%d%d",&X,&y); z = y + x; if (x<y) z = y + x; printf("%d",z); }
A.9
B.3
C.0
D.有语法错误
第1题:
若执行下列的程序时,从键盘上输入1和2,则输出结果是( )。
#include<stdio.h>
main()
{ int a,b,s;
scanf("%d%d",&a,&B) ;
S=a;
if(a<B) s=b;
s=s*s;
printtf("%d\n",s);
}
A.1
B.4
C.2
D.9
第2题:
2、在执行下述程序时,若从键盘输入字母H,则输出结果是()。 #include <stdio.h> int main() { char ch; ch=getchar(); switch(ch) { case 'H':printf("Hello! \n"); case 'G':printf("Good morning! \n"); } }
第3题:
【单选题】在执行下述程序时,若从键盘输入6和8,则输出结果是_______。 #inlude <stdio.h> main() { int a,b,s; scanf("%d%d",&a,&b); s=a; if(a<b) s=b; s*=s; printf("n%d",s); }
A.36
B.48
C.64
D.以上都不对
第4题:
在执行下述程序时,若从键盘输入字母H,则输出结果是()。 #include <stdio.h> int main() { char ch; ch=getchar(); switch(ch) { case 'H':printf("Hello! n"); case 'G':printf("Good morning! n"); } }
第5题:
【单选题】在执行下述程序时,若从键盘输入6和2,则输出结果是_______。 #inlude <stdio.h> main() { int a,b,k; scanf("%d,%d",&a,&b); k=a; if(a<b)k=a%b; else k=b%a; printf("n%d",k); }
A.5
B.3
C.2
D.0