WorksheetsQuiz1
Total questions: 15
Worksheet time: 21mins
Which of the following is not a valid C++ data type?
int
float
real
bool
Which of the following is a valid C++ keyword?
variable
method
function
class
What is the size of a char data type in C++?
8 bytes
1 byte
2 bytes
4 bytes
Which of the following operators is used for logical AND in C++?
==
!
||
&&
What is the default return type of a function in C++ if not specified?
void
int
float
double
What will be the output?
10 20
15 30
15 20
Error
Predict the output:
10 10
10 0
0 0
Compiler Error
You are designing a bank account system. Which of the following should be modeled as a class with objects in C++?
Interest rate calculations
Each customer account
Printing a statement
Inputting customer details
In recursion, which condition must always be present to avoid infinite calls?
Function overloading
Base case
Destructor
Polymorphism
Which of the following is used to include standard libraries in a C++ program?
require
#include
import
using
Write a C++ program to check whether a given number is prime using a function.
Define a Student class with attributes name, rollNo, and marks. Write a function to display the details of a student.
Which operator cannot be overloaded in C++?
+
=
::
[]
Which of the following is not a valid identifier in C++?
marks
_total
2value
value2
Write a function in C++ to compute the sum of digits of a number using recursion.
