What is a sequence? A sequence is a series of statements whose sequence and execution are coherent and have a different meaning if reversed.
There are three (3) parts of algorithm :
The step is limited
Allows it to be repeated
The step can involve decision-making
Examples of everyday life algorithm :
Buy french fries at the burger shop :
Select the desired size of the potatoes
Take enough money to pay for it
Hand over the money
Get change if possible
Take the potatoes
Arithmetic Operators
Types of arithmetic operators and examples of their application:
+ Addition 2+3
- Subtraction 7-3
* Multiplication 5*4
/ Division 12/3
^ Exponentiation 2^3
% Modulud 14%3
Hierarchy of Operations
Hierarchy is the order of execution of arithmetic operations. It is very important in the calculation process because it determines which operations must be completed first. Without a hierarchy, the calculation results can be ascertained wrong.
Hierarchy:
Perform operations in parentheses (from the inside out if there are more than one)
Perform exponentiation (1st hierarchy)
Multiplication, division, and modulus from left to right (if there are more than one) (2nd hierarchy)
Addition and subtraction from left to right (if there are more than one) (3rd hierarchy)
Comments