Exercise 8: if/else Statements

Let's test your ability to write if else statements.

Problem Statement

Given a number, print foo if the number is a multiple of 33, bar if it is a multiple of 55 and foo bar if it’s a multiple of both 33 and 55.

Use cat() to display your output.


A testVariable containing the number being tested.


The correct statement corresponding to the condition of the number.

Sample Input


Sample Output

foo bar

Test Yourself

Write your code in the given area. If you get stuck, you can look at the solution.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy