๐Ÿ’ป Day 84: Conditional Statements in C – Hinglish

 

๐Ÿ’ป Conditional Statements in C – 

๐Ÿ‘‰ Aaj hum seekhenge:
✅ Conditional statement kya hai
✅ Types (if, if-else, else-if, switch)
✅ Examples
(Programming ka very important topic) ๐Ÿ’ฏ


๐Ÿ“Œ Conditional Statement kya hai?

๐Ÿ‘‰ Jab program me condition lagate hain,
ki agar ye hoga to ye kaam karo, warna kuch aur karo.

➡️ Simple words me:
Condition = Agar / Nahi to logic.


๐Ÿงฉ Types of Conditional Statements

1️⃣ if Statement

๐Ÿ‘‰ Sirf condition true hone par code chalega.

Example:

#include <stdio.h>
int main() {
    int a = 10;
    if (a > 5) {
        printf("A is greater than 5");
    }
    return 0;
}

2️⃣ if-else Statement

๐Ÿ‘‰ Agar condition true ho to if, warna else chalega.

Example:

#include <stdio.h>
int main() {
    int a = 3;
    if (a > 5) {
        printf("A is greater than 5");
    } else {
        printf("A is not greater than 5");
    }
    return 0;
}

3️⃣ else-if Ladder

๐Ÿ‘‰ Multiple conditions ke liye.

Example:

#include <stdio.h>
int main() {
    int marks = 75;

    if (marks >= 90) {
        printf("Grade A");
    } 
    else if (marks >= 60) {
        printf("Grade B");
    } 
    else {
        printf("Grade C");
    }
    return 0;
}

4️⃣ switch Statement

๐Ÿ‘‰ Multiple choices ke liye.

Example:

#include <stdio.h>
int main() {
    int day = 2;

    switch(day) {
        case 1:
            printf("Monday");
            break;
        case 2:
            printf("Tuesday");
            break;
        default:
            printf("Invalid day");
    }
    return 0;
}

๐Ÿงช Practice Questions

✅ Theory:

  1. Conditional statement kya hai?

  2. if aur if-else me difference likho.

  3. switch statement kya hai?

✅ Practical:

๐Ÿ‘‰ Program likho:

  • Even / Odd number check

  • Marks se grade print karo


๐Ÿ“ Short Notes (Exam ke liye)

๐Ÿ‘‰ if = condition check
๐Ÿ‘‰ else = otherwise
๐Ÿ‘‰ switch = multiple choice


⬅ Previous Day


                            Next Day ➡