Search Header Logo

Quiz PF 1 (W4)

Authored by Yosi Kristian

Other

Professional Development

Used 2+ times

Quiz PF 1 (W4)
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

22 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following data types has the smallest size?

char

int

long

double

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of the following code snippet?

A

B

AB

None

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following conditions is equivalent to !(a > b)?

a < b

a <= b

a == b

a >= b

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In C++, what will happen if you do not provide an else block for an if statement?

Syntax error

The code inside the if block will not execute

The program will terminate

The program will continue to execute the next statements

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the else statement in C++?

To execute a block of code if the if condition is false

To execute a block of code if the if condition is true

To declare variables

None of the above

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many else blocks can an if statement have?

0

1

2

Unlimited

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax for an else if statement in C++?

else if (condition) { /* code */ }

elif (condition) { /* code */ }

elseif (condition) { /* code */ }

else (condition) { /* code */ }

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?