In pseudocode, there is no official standard syntax. Therefore, this pseudocode
can be applied in various programming languages. It is recommended to use commonly used keywords such as: if, then, else, while, do, repeat, for, etc. The advantage of using pseudocode notation is the ease of translating to programming language notation, because there is correspondence between each pseudocode and programming language notation.
The structure of pseudocode writing is generally the same as the writing structure
algorithm by using descriptive sentence that starts from title / header,
declaration / dictionary and end with description. Although there is no special syntax in writing pseudocode, but sometimes pseudocode is written using the style or style of writing from several existing programming languages, such as Fortran, Pascal, C and others.
Here is an example of pseudocode writing using the style of writing some programming languages:
Fortran style
program TikTokdo i=0to100
set flag to true
if i is divisible by 3
print ”Tik”
set flag to false
if i is divisible by 5
print ”Tok”
set flag to false
if flag, print i
print a newline
end do
Pascal style
procedure TikTokfor i:=0to100 do
set flag to true;
if i is divisible by 3 then
print ”Tik”;
set flag to false;
if i is divisible by 5 then
print ”Tok”;
set flag to false;
if flag, print i;
print a newline;
end
C style
void function TikTokfor(i=0;i<=100;i++){
set flag to true;
if i is divisible by 3
print ”Tik”;
set flag to false;
if i is divisible by 5
print ”Tok”;
set flag to false;
if flag, print i;
print a newline;
}
Similarly this article.
Sorry if there is a wrong word.
The end of word wassalamualaikum wr. wb
Referensi :
- Ebook Logical and Algorithm
Jika ingin bertanya secara privat, Silahkan hubungi no 085709994443 dan untuk berkomentar silahkan klick link di bawah ini 👇