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
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