*Some Important Campus Oriented Cases About "if" Statement.

 Some Important Campus Oriented Cases About "if" Statement.


int x=10 , y=5 , z=7;

1. if(x>=y)

      printf("Hello");            *O/P Hello

2. if (y>=z)

       printf("Hello");            * NO  O/P 

3. if(z==25)

       printf("Hello");             *NO O/P

4. if(z=25)

       printf("Hello");              *Will Assign In 'Z' Is Non Zero(T) O/P Hello

5. if(15)

       printf("Hello");               *Will Assign In '15' Is Non Zero(T) O/P Hello

6. if(0)

       printf("Hello");               *Will Assign In '0' Is  Zero(F) O/P NO

7. if(z=0)

      printf("Hello");                *Will Assign In '0' Is  Zero(F) O/P NO

8. if(-12)

       printf("Hello");                *Will Assign In '-12' Is Non Zero(T) O/P Hello

9. if(25.65)

       printf("Hello");               *Will Assign In '25.65' Is Non Zero(T) O/P Hello

10. if('0')

        printf("Hello");               *ASCII Value Of '0' Is 48 Non Zero(T) O/P Hello

11. if( )

         printf("Hello");              *ERROR

12. if('  ')

       printf("Hello");               *ASCII Value Of 'Space' Is 32 Non Zero(T) O/P Hello

13. if("Hello")

       printf("Hello");               *Address Non Zero O/P Hello

14. if(1,0)

        printf("Hello");            *In Case Of Comma Operatare O/W Conditions Cantrol Is Always Depends On The Last Condition

15. if(0,1)

      printf("Hello");               *In Case Of Comma Operatare O/W Conditions Cantrol Is Always Depends On The Last Condition

16. if(10,3,22,35,7,4,0)       

       printf("Hello");              *In Case Of Comma Operatare O/W Conditions Cantrol Is Always Depends On The Last Condition

17. if(1 && 0)

        printf("Hello");            *AND Rule (F)       

18. if(0::1)

       printf("Hello");             *OR Rule(T) O/P Hello

19. if(0::0)

      printf("Hello");              *OR Rule(F) 

20. if(y>=x);

      printf("Hello");             * No Error

                                               Logical Error

     


          -SHAHRUKH KHAN(CSE)

Comments

Popular posts from this blog

What Is Data Structure.Why Data Structure.And Types Of Data Structure?.

"Basic Introduction Of Programming Language:"

HTML(Hyper Text Markup Language)