若执行下述程序时,从键盘输入的数据是3和6,则程序的输出结果是()。includevoid main(){若执行下述程序时,从键盘输入的数据是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.9B.3C.0D.有语法错误

题目
若执行下述程序时,从键盘输入的数据是3和6,则程序的输出结果是()。includevoid main(){

若执行下述程序时,从键盘输入的数据是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.有语法错误


相似考题
更多“若执行下述程序时,从键盘输入的数据是3和6,则程序的输出结果是()。#include<stdio.h>void main(){ ”相关问题
  • 第1题:

    若执行下列的程序时,从键盘上输入1和2,则输出结果是()。 include main() { int a,b,s;

    若执行下列的程序时,从键盘上输入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


    正确答案:B
    解析:本题考查if语句。scanf函数通过键盘读入 a、b的值,a=1,b=2。第一个if语句,先判断条件,发现ab条件成立,则s=b=2,s=s*s=4。

  • 第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"); } }


    B 本题中a的值为6,b的值为8,最后s的值为8,s*=s等价于s=s*s。

  • 第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.以上都不对


    B 本题中a的值为6,b的值为8,最后s的值为8,s*=s等价于s=s*s。

  • 第4题:

    在执行下述程序时,若从键盘输入字母H,则输出结果是()。 #include <stdio.h> int main() { char ch; ch=getchar(); switch(ch) { case 'H':printf("Hello! n"); case 'G':printf("Good morning! n"); } }


    B 本题中a的值为6,b的值为8,最后s的值为8,s*=s等价于s=s*s。

  • 第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


    B 本题中a的值为6,b的值为8,最后s的值为8,s*=s等价于s=s*s。