Lesson 4 of 24

Conditions: if, else और switch

9 min 25 XP

if / else if / else और switch बिल्कुल C की तरह काम करते हैं। Conditions को && (AND), || (OR) और ! (NOT) से जोड़ें।

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

तीन भुजाओं की लंबाई पढ़ें। अगर त्रिभुज न बन सके तो "Invalid", वरना "Equilateral", "Isosceles" या "Scalene" print करें। Input: 3 4 5 → Output: Scalene

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