Exercise 8: if/else Statements
Let's test your ability to write if else statements.
We'll cover the following
Problem Statement
Given a number, print foo if the number is a multiple of , bar if it is a multiple of and foo bar if it’s a multiple of both and .
Use
cat()
to display your output.
Input
A testVariable
containing the number being tested.
Output
The correct statement corresponding to the condition of the number.
Sample Input
45
Sample Output
foo bar
Test Yourself
Write your code in the given area. If you get stuck, you can look at the solution.
# Write your code herecat(" ")