4. Doing Math and Comparing Things
Learn Doing Math and Comparing Things through beginner-friendly explanations, working GOCO examples, and their expected output.
4.1 Math Rules
You can do all standard math using symbols. You can add, subtract, multiply, and divide numbers.
goco
Displaynl(10 + 3). // additionDisplaynl(10 - 3). // subtractionDisplaynl(10 * 3). // multiplicationDisplaynl(10 / 3). // divisionDisplaynl(10 % 3). // remainder
4.2 Changing Numbers Quickly
You can increase or decrease your numbers fast by using ++ to add 1 and -- to take away 1.
goco
Number apples = 5.apples++.Displaynl(apples).// You can also use quick math signs.apples += 4.Displaynl(apples).
4.3 Comparing Or Checking Things
You can check if two things are the same or which one is bigger. This will always give you a True or False answer.
goco
Number x = 5.Number y = 10.Displaynl(x == y).Displaynl(x != y).Displaynl(x < y).Displaynl(True And False).
4.4 Joining Words Together
The addition sign '+' can also stick words or sentences together like glue.
goco
Sentence first = "Hello".Sentence second = "World".Displaynl(first + " " + second + "!").Displaynl("My age is: " + 12).