Arithmetic Operations
Arithmetic operations are no different from the mathematical operations you encounter in primary school.
Expressions are any way to represent an operation or a sequence of operations. This chapter will allow you to literally express yourself to your computer. Expressions and assignment statements are the basic means of computing. It is composed of variables, values, operators, and functions. Think of expressions in computers as expressions in real life. If you want to tell someone to calm down then you might use the expression “take it easy” or “cool off.” In computers, if you want to add one and two then you will have to use the expression “1 + 2.” When you communicate to fellow human beings, you use expressions. When you communicate to a computer and you want your computer to do something then you have to use expressions too.
Arithmetic Operations
Arithmetic operations are no different from the mathematical operations you encounter in primary school. Addition is represented by the “+” sign. Subtraction is represented by the “-“ sign. Multiplication is represented by the asterisk “*” sign. Division is represented by the slash “/” sign. The remainder operation can be represented using the backslash “\” sign or the “%” sign, depending on the programming language being used.
There are also some operators that you will encounter in several programming languages. The “++” sign indicates to increment the value of an element by one. The “--“ sign indicates to decrement the value of an element by one. Just like in basic algebra, attaching a “-“ sign before an element negates its value while attaching a “+” sign merely reaffirms the element’s value. Numbers without a”+” sign before it are assumed to be positive.
You can try adding and subtracting in your Visual Basic Editor. Make two new variables in your program and then add them up.