如下代码段输出c的值是() 。
int a = 3, c;
if (a > 0)
if (a > 3)
c = 2;
else
c = 3;
else
c = 4;
System.out.println("c=" + c);
int a = 3, c;
if (a > 0)
if (a > 3)
c = 2;
else
c = 3;
else
c = 4;
System.out.println("c=" + c);
举一反三
- 3、以下代码段执行后,输出结果是________。int i = 3; int j = 0; double k = 3.2; if(i < k) if(i == j) System.out.println(i); else System.out.println(j); else System.out.println(k);
- #include int main() { int a=1,b=2,c=3,d=0; if (a==1) if (b!=2) if (c==3) d=1; else d=2; else if (c!=3) d=3; else d=4; else d=5; printf("%d\n",d); return 0; }
- 若a的值为3时,下列程序段被执行后,c的值是多少?()c = 1;if ( a>0 )if ( a>3 ) c = 2;else c = 3;else c = 4;
- 如下代码段输出c的值是() 。int a = 3, c;if (a > 0)...t.println("c=" + c);
- 下列程序段运行后x的值是( )。 int a=0,b=0,c=0,x=35; if ( !a ) x--; else if ( b ) ; if ( c ) x=3; else x=4;