Consider the code segment written below in C++: if (count < 10) // if #1 if…

KVS TGT/PGT 2018Kendriya Vidyalaya Sangathan 2018

Consider the code segment written below in C++: if (count < 10) // if #1 if ((count % 4) == 2) // if #2 cout << "condition; white\n"; else // (Indentation is wrong) cout << "condition is: tan\n"; There are 2 if statements and one else. To which if, the else statement belong?

  1. A.

    It belongs to if #1

  2. B.

    It belongs to if #2

  3. C.

    It belongs to both the if statements

  4. D.

    It is independent

Attempted by 487 students.

Sign up free to check your answer

Sign up free

Explore the full course: Bpsc

Loading lesson…