下列程序段的输出结果是( )。 void doublearithmaticoperator(){ int a=10,b=4,c=20,d=6; System.out.print(a+b*c+d); System.out.print(","); System.out.print(a+c%b); System.out.print(","); System.out.println(a++*b+c*-d); }
A: 860,10,360
B: 96,10,140
C: 96,13,140
D: 860,13,360
A: 860,10,360
B: 96,10,140
C: 96,13,140
D: 860,13,360
举一反三
- 下列选项中,循环会无限执行的是______。 A: int i = 1 ; while ( i < 10) System .out .print( “ ” + i) ; B: for( int i = 1 ; i < 10 ;i ++) System .out .print( “ ” + i); C: for( int i = 10 ; i > 0 ;i --) System .out .print( “ ” + i); D: int i = 1 ; while (true) { System .out .print( “ ” + i); i ++ ; if ( i > 5) break ;
- 下列程序的运行结果是()。 public class Test public static void main ( String [ ] args ) int count = 0 for( int i = 1 i < 5 i = 2) for( int j = 1 j< = 10 j = 3) count System .out .print (count ) _
- 请看下面的程序代码,当 n 为( )值时,程序段将输出字符串 second。 [br][/br] switch(n) { [br][/br] case 0: System .out .println(“first”); [br][/br] case 1: [br][/br] case 2: System .out .println(“second”); break; [br][/br] default: System .out .println(“end”); [br][/br] }(2.0) A: 0 B: 1 C: 2 D: 以上都可以
- 下面程序段的输出结果是()int a = 2;System.out.print(a++);System.out.print( a);System.out.print(++a);
- New students spend hours in the library, trying to()the system of arranging the books. A: work out B: cross out C: set out D: put out