Sequence
What is Sequence?
- Sequence is a concept that involves executing instructions in a particular order
- It is used in programming languages to perform tasks in a step-by-step manner
- Sequence is a fundamental concept in computer science and is used in many programming languages
Pseudocode example:
PRINT "Hello, World!"
x←5
y←10
z← x + y
PRINT z
Python example:
print("Hello, World!")
x = 5
y = 10
z = x + y
print(z)
Java example:
System.out.println("Hello, World!");
int x = 5;
int y = 10;
int z = x + y;
System.out.println(z);
Visual Basic example:
Console.WriteLine("Hello, World!")
Dim x As Integer = 5
Dim y As Integer = 10
Dim z As Integer = x + y
Console.WriteLine(z)
Exam Tip
- Always remember to write your instructions in the order in which you want them to be executed