Lesson 6 of 23

&&, ||, ! এবং switch

9 min 25 XP

&& (AND) true যখন দুই দিকই true, || (OR) যখন যেকোনো একটি, আর ! (NOT) condition উল্টে দেয়। Ternary operator condition ? a : b দুটি value-র একটি বেছে নেয়।

Example: edit me and press Run

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

switch একটি value-কে অনেক case-এর সঙ্গে তুলনা করে। প্রতিটি 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.