Example 1 : Illustration of Indirect or Invisible If
More Theory :
We have seen basic concept about “Indirect Use of If Statement” . Now we are focusing on more and more short tutorials before solving MCQ’s .
#include<stdio.h>void main(){int a = 40 , b = 30 ,c;c = !(a>=0) >= 0printf("%d",c);}
Output :
1
How ?
- While Solving such a Long expression , First Scan Expression from Left to Right .
- Solve Expression bounded in Pair of ( ) .
Step 1 :
- Always Solve Bracket First
c = !(a>=0) >= 0Step 2 :
- a>=0 is True
- So Replace “a>=0″ by 1
c = !1 >= 0Step 3 :
- NOT Operator has Higher Priority Than >= Operator .
- !1 = 0
- Replace “!1″ by “0″
c = 0 >= 0Step 4 :
- Obviously 0 >= 0 is True Condition
- Replace Whole Expression by 1
c = 1Thus C = 1





