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.