NEW
Font size
WorksheetsProgramming with C++
Total questions: 15
Worksheet time: 8mins
The value 132.54 can be represented using which data type?
double
void
int
bool
Which of the following statements are true? int f(float)
f is a function taking an argument of type int and returning a floating point number
f is a function taking an argument of type float and returning an integer
f is a function of type float
none of the mentioned
Identify the user-defined types from the following
enumeration
classes
both enumeration and classes
int
Which type is best suited to represent the logical values?
integer
boolean
character
all the mentioned
Which data type is used to represent the absence of parameters?
int
short
void
float
Pick the odd one out
array type
character type
boolean type
integer type
In which type do the enumerators are stored by the compiler?
string
integer
float
none of the mentioned
Which variable does equals in size with enum variable?
int variable
float variable
string variable
none of the mentioned
What are the parts of the literal constants?
integer numerals
floating-point numerals
strings and boolean values
all of the mentioned
What is the output of this program?#include <iostream> using namespace std; int main() { int const p = 5; cout << ++p; return 0; }
5
6
error
none of the mentioned
What is the output of this program?#include <iostream> using namespace std; #define PI 3.14159 int main () { float r = 2; float circle; circle = 2 * PI * r; cout << circle; return 0; }
12.5664
13.5664
compile error
none of the mentioned
The difference between x and ‘x’ is
The first one refers to a variable whose identifier is x and the second one refers to the character constant x
The first one is a character constant x and the second one is the string literal x
both are the same
none of the above
How to declare a wide character in the string literal?
L prefix
l prefix
W prefix
none of the mentioned
Which of the following will not return a value?
null
void
empty
free
What does the following statement mean?
void a;
variable a is of type void
a is an object of type void
declares a variable with value a
flags an error
