Lesson 6 of 23

&&, ||, ! और switch

9 min 25 XP

&& (AND) तब true है जब दोनों तरफ़ true हों, || (OR) तब जब कोई एक हो, और ! (NOT) condition को उलट देता है। Ternary operator condition ? a : b दो values में से एक चुनता है।

Example: edit me and press Run

Output Loading C (first time takes a few seconds)
Press Run to see the result here.

switch एक value की तुलना कई cases से करता है। हर case को break से खत्म करें, वरना execution अगले case में चला जाता है।

Example: edit me and press Run

Output Loading C (first time takes a few seconds)
Press Run to see the result here.

Challenge

+25 XP

scanf(" %c", &ch) से एक अक्षर पढ़ें। a, e, i, o, u (छोटे या capital) के लिए "Vowel", वरना "Consonant" print करें। switch का उपयोग करें।

Output Loading C (first time takes a few seconds)
Press Run to see the result here.