If Statement in C in Hindi :- C if statement ko ham is post me example ke sath understand karte hai. if condition in c program ko isliye istemal kiya jata hai taki kisi condition ko check kar sake |
If Statement in C in Hindi
Contents
syntax if statement
if (test expression) { // statements to be executed if the test expression is true }
Aap Dekh sakte hai if statement syntax me ek expression check kar rhe hai or uske bad us statement ko ham print kar rhe hai.
Flow Chart If Statement
Aap Is Flow Chart Ko dekh Kar is ke working ko understand kar sakte hai.
C If Statement In Hindi
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 Statement Example :-
#include <stdio.h> int main() { int x = 20; int y = 22; if (x<y) # condition check { printf("Variable %d is less than %d"); } return 0;
Output :-
Variable 20 is less than 22
If Statement kese work karta hai ?
C programming me if statement aakhir kese work karta hai ham is photo ki image se understand karte hai.
Is image me aap two expression dekh sakte hai. pahli condition true and dusri condition false.
Ham if statement TRUE & FALSE Ke Example ko dekhte hai.
Example True Expression :-
#include<stdio.h> #include<conio.h> void main() { int x , y; printf("Enter The First Number :"); scanf("%d",&x); printf("Enter The Second Number :"); scanf("%d",&y); if(x>y) { printf("%d Greater Value",x); } getch(); }
Output :-
Enter The First Number : 10 Enter The Second Number :5 10 Greater Value
Example False Expression :-
C if multiple conditions in Hindi
#include<stdio.h> #include<conio.h> void main() { int x , y; printf("Enter The First Number :"); scanf("%d",&x); printf("Enter The Second Number :"); scanf("%d",&y); if(x>y) { printf("%d Greater Value",x); } printf("%d Greater Value",y); getch(); }
Output :-
Enter The First Number : 10 Enter The Second Number :50 50 Greater Value
Aap upper dekh sakte hai hamne true and false condition wale dono program ko acchi tarah se likh hai or unhe understand kiya hai.
Format specifiers in C | format specifiers in c with examples
if statement example in C Hindi
Dosto mujhe ummed hai ki aap if 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 |