1. सीखें
  2. /
  3. पाठ्यक्रम
  4. /
  5. Intermediate R for Finance

Connected

अभ्यास

If this, Else that

An extension of the if statement is to perform a different action if the condition is false. You can do this by adding else after your if statement:

if(condition) {
    code if true
} else {
    code if false 
}

निर्देश

100 XP
  • Extend the last exercise by adding an else statement that prints "Do nothing!".