Algorithm & Programming – 6th Meeting

Di pertemuan ke 6 ini kami mempelajari tentang vibonaci

I–>P–>O

I = Input (scanf, getchar,…)

P = Process (Selection [ If-else, Switch case, Nested If], Looping/Repetition [for, while, do-while], storage [file, sql, nosql ] )

O = Output (printf,…)

Contoh soal: vibonaci (1 1 2 3 5 …)

Int a = 1, b = 0, c;

For{

C = a + b;

A= b;

B=c;

Printf(“%d ”,c);

}

Contoh soal: bilangan prima (2,3,5,7,11,…)

Int angka

If (angka%2 == 0 || angka % angka == 0); i++;

If (i >= 2) printf(“Bukan prima”);

Atau

Sieve (1000) —> mencetak semua angka 1 – 1000

Lalu hilangkan angka yang dapat dibagi dengan 2,3,4,…

About adrianjsj

18 | Binusian 2019 | Game Application Technology | Devoted to Jesus | No Other Name | Dota 2 Semi-Pro player | From 94 to 62
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *