• Home
  • Game
  • C++
  • Java
  • Android
  • No Need
  • If And Else Conditional Structure In C++




    If

    If is a keyword, which is use as a conditional operator. If keyword execute the statement only if condition is fulfilled.

    if (condition) statement.












    If-else

    When if condition are false then the statement of else condition can execute

    if (condition) statement1 else statement2.


    In this code “a=10”,”b=9” there are not equal , so “if(a==b)” condition is not true .
    the output is….



    If-else-if

    When 1st if condition can false then it execute else. If we want we can add more if condition with else.
    if (condition) statement 1 else if (condition) statement 2 else.




    In this code “a=10”,”b=9” there are not equal , so “if(a>b)” condition is not true .
    the output is….



    Share this article :
     

    Post a Comment

     
    Support : Prosanta Chaki |
    Copyright © 2011. Funny Programmer - All Rights Reserved
    Proudly powered by Blogger