← Back to Course

Lesson 12: Modulus to Detect Divisibility

Practice Questions

Question 1: Complete the following code which stores true in b if x is a multiple of 10 and false otherwise.

bool b = // your code here

Question 2: Complete the following code which stores true in b if x is a multiple of 11 and false otherwise.

bool b = // your code here

Question 3: Complete the following code which stores true in b if x is a multiple of 3 and false otherwise.

bool b = // your code here

Question 4: Complete the following code which stores true in b if x is a multiple of 9 and false otherwise.

bool b = // your code here

Question 5: Complete the following code which stores true in b if x is a multiple of 2 and false otherwise.

bool b = // your code here