Multiple choice

Give output of the following int i=1,j=1; j++; if (i==11) cout<<' its eleven' ; else cout<<' its not eleven ';

  1. its eleven

  2. its not eleven

  3. Neither 1 or 2

  4. Data insufficient

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The code initializes i=1 and j=1, then increments j to 2. The condition checks if i==11, but i equals 1, not 11. Therefore, the else branch executes, printing 'its not eleven'. The value of j is irrelevant to the conditional logic.