Lesson 6 of 23

&&, ||, ! మరియు switch

9 min 25 XP

&& (AND) రెండు వైపులా true అయితే true, || (OR) ఏదో ఒకటి true అయితే, ! (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.