GOCO IDE
  • Home
  • Docs
Download

Documentation

Chapter 1: BasicsChapter 2: Variables & TypesChapter 3: Input and OutputChapter 4: Math and OperatorsChapter 5: Making DecisionsChapter 6: Repeating Parts (Loops)Chapter 7: FunctionsChapter 8: Arrays (Lists)Chapter 9: Standard Libraries

5. If Statements and Choices

5.1 The If, Elseif, and Else rules

Programs can make smart choices. It will check a rule. If the rule is True, it does the action. If not, it can check another rule using Elseif or do a default action using Else.

Number age = 10.
If (age > 18) {
Displaynl("You are an adult.").
}
Elseif (age == 18) {
Displaynl("You just became an adult!").
}
Else {
Displaynl("You are a kid.").
}

5.2 Using Switch for Many Choices

When you have lots of exact choices to pick from, a Switch is cleaner than writing many If rules.

Number luck = 2.
Switch(luck) {
Case(1) {
Displaynl("Gold Coin!").
}
Case(2) {
Displaynl("Silver Coin!").
}
Default {
Displaynl("No Coin!").
}
}

Contact Us

+91 93269 63378kancorp.inc@outlook.com
📍KanCorp Inc, India

Quick Links

  • Home
  • Docs
  • Download IDE

Stay Updated

Subscribe to get updates on new features and learning resources!

© 2026GOCO IDE™. All rights reserved. Made with ❤️