【单选题】【消耗次数:1】
以下程序的运行结果是: main() {int m=5; if(m++5) printf(%d\n else printf(%d\n,m--); }
4
5
6
7
参考答案:
复制
纠错
相关题目
【单选题】 以下程序运行结果是( )。 Main() {int if(m++5) printf(%d\n else printf(%d\n,m--); }
①  4
②  5
③  6
④  7
【多选题】 如果输入的是5,以下程序运行结果不正确的是() #include #define M n+n void main( ) { int n; int result; printf(请输入一个整数:); scanf(%d, result=M*M; printf(result = %d\n,result); }
①  100
②  35
③  25
④  50
【单选题】 下述程序的运行结果( )。 #includevoid main() { int a=5,b=4,c=3,d=2; if(ac)printf(%d\n else if((c-1=d)==1)printf(%d\n,d+1); else printf(%d\n,d+2); }
①  1
②  2
③  3
④  4
【单选题】 下述程序的运行结果( )。 #includevoid main() { int a=5,b=4,c=3,d=2; if(ac)printf(%d\n else if((c-1=d)==1)printf(%d\n,d+1); else printf(%d\n,d+2); }
①  0
②  1
③  2
④  3
【单选题】 有以下程序,执行后输出结果是() main( ) { int m[][3]={1,4,7,2,5,8,3,6,9}; int i,j,k=2; for(i=0;i { printf(%d ,m[k][i]); } }
①  4 5 6
②  2 5 8
③  3 6 9
④  7 8 9
【单选题】 下述程序的运行结果( )。 #includevoid main() { int a=1,b=2,c=3; if(c=a)printf(%d\n else printf(%d\n }
①  1
②  3
③  5
④  6
【单选题】 以下程序的运行结果是()。voidmain(){intn=9;switch(n--){default:printf("%d",n++);case8:case7:printf("%d",n);break;case6:printf("%d",n++);case5:printf("%d",n);}}
①  8
②  7
③  89
④  87
【单选题】 两次运行下面的程序,如果从键盘上分别输入4和6,则输出结果是。main( ){ int x; scanf(“%d”, if(x++5) printf(“%d”,x); else printf(“%d\n”,x++);}
①  7和5
②  6和3
③  7和4
④  6和4
【单选题】 两次运行下面的程序,如果从键盘上分别输入6和4,则输出结果是。main( ){ int x; scanf(“%d”, if(x++5) printf(“%d”,x); else printf(“%d\n”,x--);}
①  7和5
②  6和3
③  7和4
④  6和4
【单选题】 下列程序执行后的输出结果是 #includevoid main( ) { int a=5,b=60,c; if (ab) {c=a*b;printf(%d*%d=%d\n,b,a,c);} else {c=b/a;printf(%d/%d=%d\n,b,a,c);} }
①  60/5=12
②  300
③  60*5=300
④  12
随机题目
【单选题】 C语言基本数据类型包括()。
①  整型、实型、逻辑型
②  整型、实型、字符型
③  整型、字符型、逻辑型
④  整型、实型、字符串型
【单选题】
①  108
②  18
③  12
④  2
【单选题】 若有下面定义,能打印出字母L的语句是()。structclass{charname[8];intage;};structclasss[12]={"Zheng",16,"Lin",18,"Yang",19,"Guo",20};
①  printf("%c\n",s[1].name[0]);
②  printf("%c\n",s[2].name[0]);
③  printf("%c\n",s[1].name);
④  printf("%c\n",s[2].name);
【单选题】 以下叙述错误的是()
①  存放地址的变量称为指针变量
②  NULL可以赋值给任何类型的指针变量
③  一个指针变量只能指向类型相同的变量
④  两个相同类型的指针变量可以作加减运算
【单选题】 ()能正确定义一个指向函数的指针。
①  int*p()
②  int(*p)()
③  (int*)p()
④  int(*p())
【单选题】 若有定义:inta,b;floatx,则以下不符合C语言语法的表达式是()。
①  x%7
②  x/=a-b
③  a=b=2
④  x=(float)a/b
【单选题】 以下程序的运行结果是()。func(inta,intb){intc;c=(ab)?(a-b):(a+b);return(c);}main(){intx=7,y=3;printf("%d\n",func(x,y));}
①  3
②  4
③  7
④  10
【单选题】 设enumcolor{red,yellow=2,blue,white,black}r=white;,执行printf("%d",r);后的输出结果是(   )
①  0
②  1
③  3
④  4
【单选题】 若有定义:structteacher{intnum;charsex;intage;}teacher1;则下面叙述错误的是()。
①  struct是结构类型的关键字
②  structteacher是用户定义的结构类型
③  num、sex、age都是结构变量teacher1的成员
④  teacher1是结构类型名
【单选题】 若有定义:floatx=3.5,y=3.6;则表达式()的值为6。
①  (int)x+(int)y
②  x+y
③  (int)(x+y)
④  int(x+y)