Question 1 of 25
Hints left: 3
Q1
Pick the right option. Statement 1: A definition is also a declaration. Statement 2: An identifier can be declared just once.
Q2
What will be the output of the following C++ code? #include <iostream> using namespace std; int g = 100; int main() { int a; { int b; b = 20; a = 35; g = 65; cout << b << a << g; } a = 50; cout << a << g; return 0; }
Q3
What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { float f1 = 0.5; double f2 = 0.5; if (f1 == 0.5f) cout << "equal"; else cout << "not equal"; return 0; }
Q4
What will be the output of the following C++ code? #include <iostream> using namespace std; enum test { A = 32, B, C }; int main() { cout << A << B<< C; return 0; }
Q5
What does the modulus operator (%) do in C++?
Q6
What is the output of the following code: cout << (true && false); in C++?
Q7
Identify the incorrect option.
Q8
Identify the type of variables. typedef char* CHAR; CHAR p,q;
Q9
What is the operator associativity of the assignment operator (=) in C++?
Q10
Given the variables p, q are of char type and r, s, t are of int type. Select the right statement? 1. t = (r * s) / (r + s); 2. t = (p * q) / (r + s);
Q11
Identify the user-defined types from the following?
Q12
Which of the following is not a relational operator in C++?
Q13
Pick the odd one out.
Q14
What is the result of the expression: 2 * 3 + 5 / 2 in C++?
Q15
To which of these enumerators can be assigned?
Q16
What will be the value of 'x' after executing the code: int x = 10; x--; in C++?
Q17
What will be the result of the expression: 5 + 3 * 2 in C++?
Q18
Which of the following is a unary operator in C++?
Q19
Which of three sizes of floating point types should be used when extended precision is required?
Q20
What is the operator precedence of the multiplication operator (*) in C++?
Q21
What is the output of the following code: cout << (10 != 10); in C++?
Q22
What will be the output of the following code: cout << (5 == 5); in C++?
Q23
What will be the value of 'x' after executing the code: int x = 5; x += 3; in C++?
Q24
What is the result of the expression: 10 / 3 in C++?
Q25
Which of the following operators is used to access the address of a variable in C++?