If Else Ladder in C in Hindi :- C If else Ladder ko C programming me ham jab istemal karte hai jab hame bahut sari condition If else ladder in c me se kisi ek condition ko execute krani ho.
If Else Ladder in C in Hindi
C Programming me If else ladder ko ham jyada condition hone or un condition me se kisi ek condition ko execute hone par istemal karte hai. isse ham example ke sath samanjh te hai.
Syntax of if else ladder statement in c
if(condition_expression_One) { statement1; } else if (condition_expression_Two) { statement2; } else if (condition_expression_Three) { statement3; } else { statement4; }
C If Else Ladder statement syntax me expression ko check kar rhe hai or uske bad us statement ko print kar rhe hai.
if else ladder in c ko acchi tarah se samajh ne ke liye ham ab ek program banate hai. and usme ek condition lga ke us program ko run karte hai.
Example :-
#include<stdio.h> #include<conio.h> int main(){ int marks; printf("Enter your marks between 0-100\n"); scanf("%d", &marks); /* Using if else ladder statement to print Grade of a Student */ if(marks >= 90){ /* Marks between 90-100 */ printf("YOUR GRADE : A\n"); } else if (marks >= 70 && marks < 90){ /* Marks between 70-89 */ printf("YOUR GRADE : B\n"); } else if (marks >= 50 && marks < 70){ /* Marks between 50-69 */ printf("YOUR GRADE : C\n"); } else { /* Marks less than 50 */ printf("YOUR GRADE : Failed\n"); } getch(); return(0); }
Output :
Enter your marks 96 YOUR GRADE : A
Enter your marks 75 YOUR GRADE : B
Enter your marks 60 YOUR GRADE : C
Enter your marks 35 YOUR GRADE : Failed
If Else Ladder Statement in C kese work karta hai ?
C ladder if else statement kese work karta hai ham is photo ki image se understand karte hai.
Dosto mujhe ummed hai ki aap if else ladder statement with example 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 |