Sunday, January 21, 2018

[Bioinformatics 101] 006. while loop



Hello! This is Kenneth J Han!

In this post, we are going to look at while loop.




006. WHILE Loop

Problem

Using WHILE Loop, calculate 5! (factorial) .

Pseudocode

num ← 5
result ← 1

WHILE num > 0
    result ← result * num
    num ← num - 1

PRINT result

Answer

120


If you have difficulties solving problem, visit the links below!
Your source code is on ready to serve!

Python source code answer on Github
Java source code answer on Github








See you on next post!

0 개의 λŒ“κΈ€:

Post a Comment