You are on page 1of 1

QUIZ #01 for Programming Fundamentals 2024 Spring Test ID: C

Attempt all 10 Multiple Choice Questions. All questions carry equal marks.
Q1. What does "C++" stand for?
a) Computer++
b) C Plus Plus
c) Code++
d) Central Programming
Q2. Which of the following is the correct way to declare a variable in C++?
a) variable_name = 10;
b) int variable_name = 10;
c) variable_name(10);
d) declare variable_name = 10;
Q3. What is the purpose of the "cout" statement in C++?
a) It reads input from the user.
b) It writes output to the console.
c) It declares a constant variable.
d) It performs mathematical calculations.
Q4. Which operator is used for comparing two values in C++?
a) ==
b) =
c) !=
d) <<
Q5. What is the purpose of the "cin" statement in C++?
a) It declares a constant variable.
b) It writes output to the console.
c) It reads input from the user.
d) It performs mathematical calculations.
Q6. What is the correct syntax for a "for" loop in C++?
a) for i = 0; i < 10; i++
b) for (int i = 0; i < 10; i++)
c) for (i = 0; i < 10)
d) loop (i = 0; i < 10; i++)
Q7. Which data type is used to store decimal numbers in C++?
a) int
b) bool
c) float
d) char
Q8. How do you comment a single line in C++?
a) // Comment here
b) /* Comment here */
c) -- Comment here --
d) # Comment here #
Q9. What is the correct syntax for a function prototype in C++?
a) function_name: return_type parameters;
b) function_name(parameters) return_type;
c) return_type function_name(parameters);
d) parameters return_type function_name;
Q10. What is the difference between "++i" and "i++" in C++?
a) There is no difference.
b) "++i" increments the value before using it; "i++" increments the value after using it.
c) "i++" increments the value before using it; "++i" increments the value after using it.
d) "++i" and "i++" are not valid in C++.

You might also like