Search Header Logo

Modulus % (Computer Science)

Authored by Edward Barcenas

Computers

9th - 12th Grade

Used 10+ times

Modulus % (Computer Science)
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which if statement correctly checks if a number is even?

if ( number % 2 != 0 )

if ( number % 2 == 0 )

if ( number % 2 == 1 )

if ( number % 2 == 2 )

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which if statement checks if a number is divisible by 5?

if ( number % 5 != 0 )

if ( number % 5 == 1 )

if ( number % 5 == 0 )

if ( number % 5 == 5 )

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which if statement checks if a number is not divisible by 7?

if ( number % 7 == 7 )

if ( number % 7 != 0 )

if ( number % 7 == 0 )

if ( number % 7 != 7 )

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which if statement correctly checks if a number is divisible by both 3 and 4?

if ( number % 3 == 0 && number % 4 == 0 )

if ( number % 3 == 0 || number % 4 == 0 )

if ( number % 3 != 0 && number % 4 != 0 )

if ( number % 3 != 0 || number % 4 != 0 )

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which if statement checks if the first number is divisible by the second number?

if ( firstNumber % secondNumber == 1 )

if ( firstNumber % secondNumber == 0 )

if ( firstNumber == secondNumber % 0 )

if ( firstNumber % secondNumber != 0 )

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which if statement checks if a number is not divisible by 2 and not divisible by 3?

if ( number % 2 == 0 && number % 3 == 0 )

if ( number % 2 != 0 && number % 3 != 0 )

if ( number % 2 != 0 && number % 3 == 0 )

if ( number % 2 == 0 && number % 3 != 0 )

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which if statement checks if a number is divisible by 6 but not by 9?

if ( number % 6 == 0 && number % 9 == 0 )

if ( number % 6 == 0 && number % 9 != 0 )

if ( number % 6 != 0 && number % 9 != 0 )

if ( number % 6 != 0 && number % 9 == 0 )

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?