Question 1
What is a function in C++?
A data type
A reusable block of code
A variable
A loop
Question 2
What is the scope of a local variable?
Entire program
Function or block
File
Class
Question 3
What does the static keyword do in a function?
Makes the variable global
Preserves value between calls
Allocates dynamic memory
Makes it constant
Question 4
Which function is typically executed first when a program begins execution?
main()
class()
loop()
variable()
Question 5
What is the lifetime of a global variable?
Function duration
Block duration
Program duration
Loop duration
There are 5 questions to complete.