
C++ Programming Test
Quiz
•
Computers
•
6th - 8th Grade
•
Practice Problem
•
Hard
JUNIEL BRAVO
Used 6+ times
FREE Resource
Enhance your content in a minute
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;
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Робот Карел 01
Quiz
•
6th - 7th Grade
16 questions
SUMATIF 1
Quiz
•
7th Grade
15 questions
HTML - pagina de bază și formatarea textului
Quiz
•
8th Grade
10 questions
mouse
Quiz
•
1st - 8th Grade
10 questions
BAI 1. Mặt trái của Internet
Quiz
•
6th Grade
17 questions
Networks Lesson 2 - Recap and Review
Quiz
•
6th - 8th Grade
14 questions
Robots and sensors G6
Quiz
•
5th - 7th Grade
10 questions
Visual Basic 2010
Quiz
•
8th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
