Sunday, January 21, 2018

[Bioinformatics 101] 003. Operators



Hello! This is Kenneth J Han!

In this post, we are going to look at basic operators.





003. Operators

Problem
Put 7 in variable "num1", and put 2 in variable "num2".
Then calculate the two operands : "add +", "subtract -", "multiply *", "divide /", "remainder %" and power.
Pseudocode
num1 ← 7
num2 ← 2
PRINT num1 + num2
PRINT num1 - num2
PRINT num1 * num2
PRINT num1 / num2
PRINT num1 % num2
PRINT POW(num1, num2)
Answer
9
5
14
3.5
1
49

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