Lesson 5 of 23
if, else आणि else if
8 min 25 XP
if आपली condition true असेल तरच कोड चालवते. अधिक पर्यायांसाठी 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 मधला क्लासिक सापळा आहे.