if else statement in c in Hindi :- C 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 example In Hindi.
If Else Statement In C In Hindi
Contents
If else Statement ka ham pahle syntax Dekhte hai .
Syntax if else statement
If condition ke bad else condition hoti hai.
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 Flow Chart
Aap Is Flow Chart Ko dekh Kar is ke working ko understand kar sakte hai.
C Programming If Else In C in Hindi
Else If Statement ko acchi tarah se understand karne ke liye ham ab ek program banate hai. and usme ek condition lga ke us program ko run karte hai.
If Else Statement Example :-
#include <stdio.h> int main() { int x = 20; int y = 22; if (x>y) # condition check { printf("Greater %d",x); } else { printf("Greater %d",y); } return 0;
Output :-
Greater 22
If Else Statement kese work karta hai ?
C if else statement kese work karta hai ham is photo ki image se understand karte hai.
Aap Is image me aap two expression dekh sakte hai. pahli condition true and dusri condition false.
C If else Statement In Hindi
Ham if else statement TRUE & FALSE Ke Example ko dekhte hai.
Example If else True Expression :-
#include <stdio.h> int main() { int x = 25; int y = 20; if (x>y) # condition check { printf("Greater %d",x); # true condition } else { printf("Greater %d",y); } return 0;
Output :-
Greater 25
Example If Else False Expression :-
#include <stdio.h> int main() { int x = 20; int y = 25; if (x>y) # condition check { printf("Greater %d",x); } else { printf("Greater %d",y); # false condition } return 0;
Output
Greater 25
Aap upper dekh sakte hai hamne true and false condition wale dono program ko acchi tarah se likh hai or unhe understand kiya 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 <stdio.h> #include <conio.h> int main() { int number; printf("Enter an integer: "); scanf("%d", &number); // True if the remainder is 0 if (number%2 == 0) { printf("%d is an even integer.",number); } else { printf("%d is an odd integer",number); } return 0; }
Output :-
Enter an integer: 7 7 is an odd integer
C Programming Full Course| Full Course C programming in Hindi
if Else statement example in C in Hindi
Dosto mujhe ummed hai ki aap if else statement example in C 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 |