下列程序段运行后x的值是()。 int a = 0, b = 0, c = 0, x = 35; if (!a) x--; else if (b); if (c) x = 3; else x = 4;A.34B.35C.3D.4

下列程序段运行后x的值是()。 int a = 0, b = 0, c = 0, x = 35; if (!a) x--; else if (b); if (c) x = 3; else x = 4;

A.34

B.35

C.3

D.4


参考答案和解析
4

相关考题:

有下面程序段: a:=false;b:=false;c:=false; x:=15; if a then x:=x0 else if b then x:=x-5 else if c then x:=20 else x:=25; 假设所有变量均已说明,程序运行后x的值是( ) 。 A25B20C15D5

● 给定C 语言程序:int foo( int x, int y, int d){if( x != 0 ) {if ( y == 0 ) d = d / x;else d = d / (x * y );} else {if( y == 0 ) d = 0;else d = d / y;}return d ;}当用路径覆盖法进行测试时,至少需要设计 (31) 个测试用例。(31)A. 3 B. 4 C. 5 D. 8

给定C语言程序:int foo(int x, int y,int d){if ( x !=0 ) {if ( y == 0 ) d = d / x;else d=d/(x*y);} else {if ( y == 0 ) d = 0;else d=d/y;}return d;}当用路径覆盖法进行测试时,至少需要设计(31)个测试用例。A.3B.4C.5D.8

假定所有变量均已正确说明,下列程序段运行后x的值是( )。a=b=c=0;x=12;if(!a)x--;else x=5;if(C) x=3;else x=4;A.11B.4C.12D.3

下面程序段中正确的是()。A.If x=2 Then y=3B 下面程序段中正确的是( )。A.If x<0 Then y=0 If x<1 Then y=1 If x<2 Then y=2 If x>=2 Then y=3B.If x>=2 Then y=3 If x>1 Then y=2 If x>=0Then y=1 If x>0 Then y=0C.If x<0 Then y=0 Else If>=0Then y=1 Else y=3 End IfD.If x>=2 Then y=3 Else If>=1 Then y=2 Else y=0 End If

有以下程序: #includestdio.h main( ) {int x=1,y=0; if(!x)y++; else if(x==0) if(x)y+=2; else y+=3; Drintf("%d\n"。v); } 程序运行后的输出结果是( )。A.3B.2C.1D.0

下列程序的运行结果是()。includemain(){int a=0,b=4,c=0,d=10,x; if(a)d=d-10; elseif 下列程序的运行结果是( )。 #include<stdio.h> main() { int a=0,b=4,c=0,d=10,x; if(a) d=d-10; else if(!b) if(!c) x=15; else x=25; printf("%d\n",d); }A.5B.3C.20D.10

假定所有变量已正确说明,下列程序段运行后,x的值是 ( ) a=b=c=0;x=35; if (! a) x- -; else if (b); if (c) x=3; else x=4;A.34B.4C.35D.3

假定所有变量均已正确说明,下列程序段运行后x的值是 ( ) a=b=c=0;x=35; if(! a)x--; eles if(b); if(c) x=3; else x=4;A.34B.4C.35D.3

下列程序的运行结果是()。includemain(){int x=5,a=1,b=2,c=5,d=0; if(a 下列程序的运行结果是( )。 #include<stdio.h> main() { int x=5,a=1,b=2,c=5,d=0; if(a<B) if(b!=3) if(!C) x=1; else if(D) x=1; else x=-1; printf("%d",x); }A.-1B.0C.1D.不确定的值

下列程序的运行结果是( )。 main() { int a=-5,b=1,c=1; int x=0,y=2,z=0; if(c>0)x=x+y; if(a<=0) { if(b>O) if(c<=0)y=x-y; } else if(c>0)y=x-y; else z=y; printf("%d,%d,%d\n",x,y,z); }A.2,2,0B.2,2,2C.0,2,0D.2,0,2

下列程序的运行结果是( )。main(){ int a=-5,b=1,c=1;int x=0,y=2,z=0;if(c>0) x=x+y;if(a<=0){ if(b>0)if(c<=0) y=x-y;}else if(c>0) y=x-y;else z=y;printf("%d,%d,%d\n",x,y,z);}A.2,2,0B.2,2,2C.0,2,0D.2,0,2

有下列程序: inelude main() { int x=8; for(;x>0;x--) 有下列程序: #inelude <stdio.h> main() { int x=8; for(;x>0;x--) { if(x%3) {printf("%d,",x--);continue;} printf("%d,",--x); } } 程序的运行结果是( )。A.7,4,2B.8,7,5,2C.9,7,6,4D.8,5,4,2

下列程序的运行结果是()。includemain(){ int a=0,b=4,c=0,d=10,x;if(a) d=d-10;else i 下列程序的运行结果是( )。 #include<stdio.h> main() { int a=0,b=4,c=0,d=10,x; if(a) d=d-10; else if(!b) if(!c) x=15; else x=25; printf("%d\n",d); }A.5B.3C.20D.10

有以下程序#inclUdestdio.hmain(){int x=1。y=0;if(!x)y++;else if(x==0)if(x)y+=2;else y+=3; .printf(“%d\n”,y);}程序运行后的输出结果是A.3B.2C.1D.0

假定所有变量均已正确说明,下列是程序段运行后x的值是 ( ) a=b=C=O;x=35; if(! a)x- -; else if(b); if(c)x=3; else x=4;A.34B.4C.35D.3

假定所有变量均已正确说明,以下程序段运行后,x的值是______。a=b=c=0;x=35;if(!a) x--;else if(b);if(c)x=3;else x=4;A.34B.4C.35D.3

假定所有变量均已正确说明,下列程序段运行后x的值是 a=d=c=0;x=35; if(! a) x=-1, else if(b) ; if(c) x=3; else x=4;A.34B.4C.35D.3

设int i=10,j=11,k=12,x=0;执行语句: if(i>5) if(j>100) if(k>11) X=3; else x=4; else x=5; 后x的值是( )。A.0B.3C.4D.5

有以下程序#includemain(){ int x=1,y=0;if(!x) y++;else if(x==0)if (x) y+=2;else y+=3;printf(%d\n,y);}程序运行后的输出结果是A.3B.2C.1D.0

有一函数:以下程序段中不能根据x值正确计算出y值的是A.if(x0)y=1; else if(x= =0)y=0; else y=-1;B.y=0; if(x0)y=1; else if(x0)y=-1;C.y = 0; if (x = 0) if (x0) y = 1; else y = -1;D.if ( x = 0) if ( x0)y = 1; else y = 0; else y = -1;

假定所有变量均已正确定义,下列程序段运行后X的值是( ) a=b=c=0; x=35; if(!a)x--; else if(b);if(c)x=3;else x=4;A.34B.4C.35D.3

(27)有以下程序#include stdio.hmain(){ int x=1,y=0;if(!x) y++;else if(x==0)if (x) y+=2;else y+=3;printf("%d\n",y);}程序运行后的输出结果是A)3B)2C)1D)0

以下不能实现符号函数y=sgn(x)的程序段是()。A、if x0 then y=1 else if x=0 then y=0 else y= -1B、if x0 then y=1 else if x0 then y= -1 else y=0C、if x=0 then if x=0 then y=0 else y= -1 else y=1D、if x0 then if x0 then y= -1 else y= 1 else y=0

下列程序运行后的输出结果是()。  #include   main( )  { int x=9;   for(; x0; x--){   if(x%3==0){     printf(“%d”,--x);     continue;    }   }  }

请写出下列代码段的运行结果 int x=0; int y=-1; if(x!=0) if(x0)y=1; else y=0;

问答题请写出下列代码段的运行结果 int x=0; int y=-1; if(x!=0) if(x0)y=1; else y=0;

单选题以下不能实现符号函数y=sgn(x)的程序段是()。Aif x0 then y=1 else if x=0 then y=0 else y= -1Bif x0 then y=1 else if x0 then y= -1 else y=0Cif x=0 then if x=0 then y=0 else y= -1 else y=1Dif x0 then if x0 then y= -1 else y= 1 else y=0