IF ELSE STATEMENT IN C PLUS PLUS IN HINDI

If Else Statement In C++ In Hindi | Control Statements in C++ in Hindi

C++

If Else Statement in C++ In Hindi :- If else Statement ko Ham Is Post Me Example Ke Sath understand Karte Hai | Else if Condition C++ Program Me Isliye Istemal Kiya Jata Hai Taki Kisi Condition Ko Check Kar Sake |

If Else Statement In C++ In Hindi

Contents

If Else Statement in Hindi Har Programming Language Me Istemal Ki Jati Hai | Jab Hamare Duvara Diya Gaya Test Expression Agar True Hota Hai To If Statement Execute Hota Hai Or Agar Test Expression False Hota Hai Tab Else Wala Expression Execute Hota Hai |

Read Also : Full Course C programming in Hindi

Control Statements in C++ in Hindi

If else Statement Ka Ham Pahle Syntax Dekhte hai | If Condition Ke Bad Else Condition Hoti Hai |

Syntax If Else Statement in C++ In Hindi

if (test expression) {
    // statements to be executed if the test expression is true
}
else {
    // statements to be executed if the test expression is false
}

If Else Statement Syntax Me Expression Ko Check Kar Rhe Hai or Uske Bad Us Statement Ko Ham Print Kar Rhe Hai |

If Else Statement C++ Flow Chart

if else statement c or cpp in hindi

Aap Upper Diye Gaye Is Flow Chart Ko Dekh Kar Is ke Working Ko Understand Kar Sakte Hai |

C++ If Else Statement In Hindi

Else If Statement in Hindi Ko Acchi Tarah Se Understand Karne Ke Liye Ham Ab Ek Program Banate Hai And Usme Ek Condition Laga Ke Us Program Ko Run Karte Hai |

If Else Statement C++ Example :-

#include <iostream>
using namespace std;
int main()
{
    int x = 20;
    int y = 18;
    if (x>y)               // condition check 
    {
        cout<<"Greater Number "<<x;
    }
    else 
    {
       cout<<"Less Number "<<y;
    }
    
    return 0;
}

Output :-

Greater Number 20    

If Else Statement Kaise Work karta Hai ?

C++ if else Statement Kaise Work Karta Hai Ham Niche Digye Image Ko Dekh kar Understand Karte Hai |

if statement in c working expression

if statement in c working Expression

Aap Upper Diye Image Me Aap Two Expression Dekh Sakte hai | First Condition True And Second Condition False Hai |

If Else Statement In C++ Hindi

Example If else True Expression 1:-

#include <iostream>
int main()
{
    int x = 25;
    int y = 20;
    if (x>y)               // Check Condtion
    {
        cout<<"Greater Value"<<x;     // True condition
    }
    else 
    {
       cout<<"Less Value"<<y;      // False Condition
    }
    
    return 0;

Output :-

Greater Value 25

Example If Else False Expression 2:-

#include <stdio.h>
int main()
{
    int x = 20;
    int y = 25;
 
    if (x>y)               // Check Condtion
    {
        cout<<"Greater Value"<<x;     // True condition
    }
    else 
    {
       cout<<"Less Value"<<y;      // False Condition
    }
    
    return 0;

Output

Less Value 25

Aap Upper Dekh Sakte Hai Hamne True and False condition Wale Dono Program Ko Acchi Tarah Se Likhe Hai or Aap Unhe Understand Kar Sakte Hai |

Program – Check whether an integer is odd or even

Odd No :- [ 1,3,5,7,9,11,13,15,17,19… ]

Evan No :- [ 0,2,4,6,8,10,12,14,16,18,20… ]

Example Program :-

#include <iostream>
using namespace std;
int main()
{
    int number;
    cout<<"Enter an integer: ";
    cin>>number;

    // True if the remainder is 0

    if  (number%2 == 0) 
    {
        cout<<"Even integer :"<<number;
    }
    else
    {
        cout<<"Odd integer."<<number;
    }
    return 0;
}

Output :-

Enter an integer: 10                                                                                                          
Even integer :10  

Control Statements in C++ in Hindi

Also Read This Post

Dosto mujhe ummed hai ki aap If Else Statement In C++ In Hindi ko acchi tarah se samanj gye honge agar aap ko ye post acchi lage to mere is website ko jarur follow kre or ha agar aap video bhi dekhna chahte hai to aap mere channel ko bhi subscribe kar sakte hai. channel ka link aapko home page par mil jayega |

Leave a Reply

Your email address will not be published. Required fields are marked *