Examveda
Examveda

Find the output of the following program.
#include<stdio.h>
void main()
{
   int y=10;
   if(y++>9 && y++!=11 && y++>11)
      printf("%d", y);
   else
      printf("%d", y);
}

A. 11

B. 12

C. 13

D. 14

E. Compilation error

Answer: Option B

Solution(By Examveda Team)

Since the second condition is false so, further conditions will not be checked, it will be skipped.


This Question Belongs to C Program >> Operators And Expressions

Join The Discussion

Comments ( 4 )

  1. Shantaram Nana
    Shantaram Nana :
    2 years ago

    Y=10;
    (Y++>9)
    (10++>9)
    Y=11
    So , second condition is false y=11

  2. Narendra B
    Narendra B :
    3 years ago

    How?

  3. Uroos Saleem
    Uroos Saleem :
    4 years ago

    Answer should be 11

  4. Grigory Peter
    Grigory Peter :
    7 years ago

    how this happens

Related Questions on Operators and Expressions