
C++ Functions and Variables Quiz
Authored by Fidaa Abed
Science
9th - 12th Grade
Used 1+ times

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
What is the purpose of the return statement in a function?
To define the function
To terminate the program
To return a value to the calling function
To initialize variables
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the return type of the pow function in C++?
int
float
double
void
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements correctly defines a function that returns an integer value?
void sum(int a, int b) { return a + b; }
int sum(int a, int b) { return a + b; }
double sum(int a, int b) { return a + b; }
bool sum(int a, int b) { return a + b; }
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which return type should be used if a function needs to return true or false?
int
double
bool
void
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a characteristic of a local variable?
It is accessible by all functions in a program.
It retains its value between function calls.
It exists only while the function is executing.
It is automatically initialized to zero.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens to a local variable once a function ends?
It retains its value.
It gets destroyed.
It becomes a global variable.
It is automatically saved for future use.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main reason to avoid using global variables?
They make programs easier to debug.
They increase execution speed.
They make programs difficult to debug.
They can only be used within the main function.
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
15 questions
Pop Science: DNA
Quiz
•
8th - 12th Grade
10 questions
Pianeti alieni
Quiz
•
12th Grade
11 questions
Historia de la tecnología y redes sociales
Quiz
•
11th Grade
10 questions
REPRESENTACIÓN DEL ÁTOMO
Quiz
•
9th Grade
20 questions
X IPS 4 TEORI TERJADINYA BUMI PERBAIKAN NILAI
Quiz
•
10th - 12th Grade
15 questions
Acid, Bases and Salt
Quiz
•
10th - 12th Grade
13 questions
INTERACT GENERAL KNOWLEGE TRIVIA
Quiz
•
7th - 12th Grade
10 questions
Quiz-Science
Quiz
•
10th Grade
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
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
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Science
25 questions
Naming Ionic and Covalent Compounds
Quiz
•
9th Grade
20 questions
Mendelian Genetics Review
Quiz
•
9th Grade
10 questions
Exploring Weathering, Erosion, and Deposition Processes
Interactive video
•
6th - 10th Grade
10 questions
Exploring Mendelian Genetics and Punnett Squares
Interactive video
•
6th - 10th Grade
10 questions
Exploring Light and Waves Concepts
Interactive video
•
6th - 10th Grade
20 questions
The Cell Cycle and Mitosis
Quiz
•
9th Grade
35 questions
DNA Structure and Replication
Quiz
•
10th Grade
89 questions
Unit 1 (Ch 2 & 3) Test Review - Water/Ocean Currents
Quiz
•
9th - 12th Grade