Question 1 of 25
Hints left: 3
Q1
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; }
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
Which of the following is not a relational operator in C++?
Q5
What will be the value of 'x' after executing the code: int x = 5; x += 3; in C++?
Q6
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);
Q7
What is the output of the following code: cout << (10 != 10); in C++?
Q8
Pick the right option. Statement 1: A definition is also a declaration. Statement 2: An identifier can be declared just once.
Q9
What is the output of the following code: cout << (true && false); in C++?
Q10
What is the operator associativity of the assignment operator (=) in C++?
Q11
What is the operator precedence of the multiplication operator (*) in C++?
Q12
What does the modulus operator (%) do in C++?
Q13
Identify the type of variables. typedef char* CHAR; CHAR p,q;
Q14
What is the result of the expression: 2 * 3 + 5 / 2 in C++?
Q15
Which of three sizes of floating point types should be used when extended precision is required?
Q16
To which of these enumerators can be assigned?
Q17
Which of the following is a unary operator in C++?
Q18
What will be the output of the following code: cout << (5 == 5); in C++?
Q19
Identify the user-defined types from the following?
Q20
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; }
Q21
What will be the result of the expression: 5 + 3 * 2 in C++?
Q22
Which of the following operators is used to access the address of a variable in C++?
Q23
Identify the incorrect option.
Q24
What is the result of the expression: 10 / 3 in C++?
Q25
What will be the value of 'x' after executing the code: int x = 10; x--; in C++?