C++ Programming Test

C++ Programming Test

6th - 8th Grade

12 Qs

quiz-placeholder

Similar activities

ICT REVISION

ICT REVISION

8th Grade

10 Qs

HTML Basics

HTML Basics

8th - 10th Grade

10 Qs

C++ Quiz 4: Arrays and Vectors

C++ Quiz 4: Arrays and Vectors

7th - 12th Grade

7 Qs

Web Development - CSS (Styling)

Web Development - CSS (Styling)

6th - 8th Grade

17 Qs

Алгоритмы ветвления

Алгоритмы ветвления

8th Grade

17 Qs

ABD3 (C++)

ABD3 (C++)

8th Grade

12 Qs

VIII C++ k v2

VIII C++ k v2

8th Grade

10 Qs

Passing Pointers C++

Passing Pointers C++

6th - 8th Grade

10 Qs

C++ Programming Test

C++ Programming Test

Assessment

Quiz

Computers

6th - 8th Grade

Hard

Created by

JUNIEL BRAVO

Used 6+ times

FREE Resource

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of cin in C++?

To output text to the console

To read input from the console

To declare a variable

To perform a mathematical operation

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax for the cout statement in C++?

Console.out("Hello World");

System.out.print("Hello World");

cout << "Hello World";

print("Hello World");

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of an if statement in C++?

To repeat a block of code a certain number of times

To exit a loop

To compare two values and execute code if they are equal

To check if a condition is true and execute code if it is

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

To execute code if the previous if condition is false

To execute code if the previous if statement is true

To compare two values and execute code if they are equal

To exit a loop

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a valid C++ data type?

int

false

float

boolean

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between a while loop and a for loop in C++?

A for loop is used for repeating a block of code a certain number of times, while a while loop is used for repeating a block of code while a condition is true.

A while loop is used for repeating a block of code a certain number of times, while a for loop is used for repeating a block of code while a condition is true.

A for loop is used for reading input from the console, while a while loop is used for outputting text to the console.

A while loop is used for outputting text to the console, while a for loop is used for reading input from the console.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax for declaring a variable of type int in C++?

integer x = 5;

x = 5;

int = x;

int x;

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?