java - Can someone explain what the output will be? -


int oc = 0; int num = stdin.readint(); (int = 1; < num; i++) {   int val = stdin.readint();   if ( val % 2 != 0)       oc++;   else         stdout.println(val); } stdout.println( " tally " + oc); 

which 1 of input sets below result in 4 lines of output?

5 3 6 8 9 7 8 9

4 2 4 5 6 7 8 9 4

5 6 4 2 3 9 8 7 5 1

6 9 8 5 3 4 13 12

option a: 5 3 6 8 9 7 8 9

because code checking if number print otherwise increase counter oc. code printing 1 line @ end every time, need check 3 numbers in option, because need output in 4 lines. hence option satisfies condition.


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -