computer quiz

computer quiz

12th Grade

37 Qs

quiz-placeholder

Similar activities

Attainment 4 - Classroom Activity (Grade 10)

Attainment 4 - Classroom Activity (Grade 10)

9th Grade - University

35 Qs

PLTW CSP Fall Exam 2024

PLTW CSP Fall Exam 2024

9th - 12th Grade

38 Qs

Computer Science Vocabulary (StLeOb)

Computer Science Vocabulary (StLeOb)

6th Grade - University

34 Qs

Arrays, Arraylists, 2D Arrays

Arrays, Arraylists, 2D Arrays

9th - 12th Grade

35 Qs

Flowchart Test

Flowchart Test

9th - 12th Grade

42 Qs

AP CSP Programming Test

AP CSP Programming Test

9th - 12th Grade

40 Qs

Java Control Structures

Java Control Structures

11th Grade - Professional Development

39 Qs

CS 1: Big Idea #3 Practice

CS 1: Big Idea #3 Practice

9th Grade - University

32 Qs

computer quiz

computer quiz

Assessment

Quiz

Computers

12th Grade

Hard

Created by

PDCS Server

Used 2+ times

FREE Resource

37 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of an if statement in C++?
To execute a block of code repeatedly
To make decisions and execute a block of code conditionally
To perform arithmetic operations
To declare variables

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax for an if statement in C++?
if condition {}
if (condition) {}
if: condition {}
if [condition] {}

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How does an if statement determine which code block to execute?
By comparing values
By looping through statements
By evaluating a condition to true or false
By checking data types

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In C++, what will the following code print if x is 5? if (x > 0) cout << "Positive";
Positive
Nothing
Syntax error
Negative

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used to specify an alternative block of code in an if statement when the condition is false?
else
elseif
alternative
or

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following correctly checks if x is not equal to 0 in an if statement?
if (x == 0)
if (x != 0)
if (x >= 0)
if (x <= 0)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of this code snippet if x is 5 and y is 10? if (x > y) cout << "X"; else cout << "Y";
X
Y
X and Y
Syntax error

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?