Locked lesson.
About this lesson
Let's learn how to perform basic math functions: Addition, Subtraction, Multiplication, Division.
Exercise files
Download this lesson’s related exercise files.
13 - Math (Addition, Subtraction, Multiplication, Division).docx60.8 KB 13 - Math (Addition, Subtraction, Multiplication, Division) SOLUTION.docx
57.8 KB
Quick reference
Math (Addition, Subtraction, Multiplication, Division)
C# allows us to do math easily.
When to use
Do this whenever you need to use math in your program.
Instructions
Math operators include:
+ // addition
- // subtraction
* // multiplication
/ // division
Hints & tips
- The basic math operators are + - * /
- They act mostly how you would expect them to act
- If you perform math on variables, be aware of the data types you use: int, float, etc.
Lesson notes are only available for subscribers.