Lesson 5 of 23

if, else మరియు else if

8 min 25 XP

Condition true అయినప్పుడే if కోడ్‌ను నడుపుతుంది. ఎక్కువ ఎంపికలకు else if, మిగతా అన్నింటికీ else వాడండి. C లో 0 అంటే false, ఏ non-zero value అయినా true.

Example: edit me and press Run

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

if (x = 5) x లో 5 ను ఉంచుతుంది, ఎప్పుడూ true! పోల్చడానికి == వాడండి. ఈ bug C లో క్లాసిక్ ఉచ్చు.

Challenge

+25 XP

ఒక సంఖ్యను చదవండి. "Positive", "Negative" లేదా "Zero" print చేయండి.

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