Ilustrasi coding (Pexels/Lukas)
Untuk lebih memudahkan kamu dalam belajar pemrograman pseudocode, kamu bisa melihat beberapa contohnya. Dengan begini, kamu bisa lebih mudah seperti apa bentuk penulisannya. Yuk, simak di bawah ini.
Contoh 1:
Program Penjumlahan
Kamus
a, b : integer
hasil : integer
Deskripsi Algoritma
a <- 10
input(b)
hasil <- a + b
output(hasil)
Contoh 2:
This program will allow the user to check the number whether it's even or odd.
Example:
if "1"
print response
"I am case 1"
if "2"
print response
"I am case 2"
Contoh 3:
//This program calculates the Lowest Common multiple
//for excessively long input values
import java.util.*;
public class LowestCommonMultiple {
private static long
1cmNaive(long numberOne, long numberTwo)
{
long lowestCommonMultiple;
lowestCommonMultiple
= (numberOne * numberTwo)
/ greatestCommonDivisor (numberOne, numberTwo);
return lowestCommonMultiple;
}