top of page
Writer's pictureD A Rosi Arsida Wardani

Sequence

Updated: May 20, 2021

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 :

  1. The step is limited

  2. Allows it to be repeated

  3. The step can involve decision-making

Examples of everyday life algorithm :

Buy french fries at the burger shop :

  1. Select the desired size of the potatoes

  2. Take enough money to pay for it

  3. Hand over the money

  4. Get change if possible

  5. 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:

  1. Perform operations in parentheses (from the inside out if there are more than one)

  2. Perform exponentiation (1st hierarchy)

  3. Multiplication, division, and modulus from left to right (if there are more than one) (2nd hierarchy)

  4. Addition and subtraction from left to right (if there are more than one) (3rd hierarchy)


 

Programming






Recent Posts

See All

One-dimensional Arrays

One-dimensional arrays are data structures that contain data types of the same type. In the form of a group of related memories...

Loop

Introduction Examples of algorithms in everyday life : Example 1 : To finish eating a plate of rice (initial conditions) Mouthfuls of a...

Comments


Post: Blog2_Post
bottom of page