【单选题】下面 C代码的输出结果是()。int answer,result;answer=100;result=answer-10;printf( “The result is %d” , result+5);
A. The result is 90
B. The result is 95
C. The result is 10
D. The result is 100
A. The result is 90
B. The result is 95
C. The result is 10
D. The result is 100
举一反三
- 以下程序的运行结果为( ) #include[stdio.h] int main() { int answer,result; answer=100; result=answer-10; printf("The result is %i\n",result+5); return 0; }
- 以下代码执行的结果是:( )int i=2;int result = 0;switch (i) {case 1:result = result + i;case 2:result = result + i * 2;case 3:result = result + i * 3;}System.out.println(result); A: 0 B: 2 C: 4 D: 10
- 下面程序段的输出结果是( )。 public class Test public static void main ( String[] args) int result=0; for ( int i=1;i<=5;i++) if ( i%2==0 ) continue; result + =i; System. out. println ("result is " + result ); A: result is 7 B: result is 8 C: result is 9 D: result is 10
- 下面程序段的输出结果是( )。 public class Test public static void main (String[] args) int n=10,result=0; for (int i=1;i<=n;i++) result+=i; System.out.println("result is"+result); A: A) result is 55 B: B) result is 45 C: C) result is 56 D: D) result is 54
- 把下面代码补全:计算10的阶乘并输出。[br][/br] int result = 1; for(int i = 2; i <= 10; i++){ } System.out.println(“result=”+ result);