C and C++ Quiz
Test your knowledge of C and C++ programming with this comprehensive quiz.
Full Name
*
First Name
Last Name
Email Address
*
example@example.com
Which of the following is a valid variable declaration in C?
*
int 1var;
int var_1;
1int var;
var int1;
Which operator is used to access the value at the address stored in a pointer variable in C?
*
*
&
#
%
Which of the following is NOT a C++ feature?
*
Classes and Objects
Operator Overloading
Garbage Collection
Function Overloading
What is the output of the following C code? int a = 5; printf("%d", a++);
*
5
6
Error
Undefined
Which C++ access specifier makes class members accessible only within the same class?
*
private
public
protected
internal
Select all valid data types in C.
*
float
double
real
char
Which of the following statements about C++ inheritance is correct?
*
A class can inherit from multiple classes.
A class can only inherit from one class.
Inheritance is not supported in C++.
A class must inherit from at least one class.
In C, the
Function name
function is used to allocate memory dynamically.
Rate your familiarity with pointers in C/C++.
*
1
2
3
4
5
Write a short code snippet in C++ to print 'Hello, World!'
*
Review the following code and identify any errors: int main() { int arr[5]; arr[5] = 10; return 0; }
Submit Quiz
Should be Empty: