Question 1 of 25
Hints left: 3
Q1
What is the value of the following 8-bit integer after all statements are executed? int x = 1; x = x << 7; x = x >> 7;
Q2
Which of the following statements are true? int f(float)
Q3
What will be the output of the following C++ code? #include <iomanip> #include <iostream> using namespace std; int main() { cout << setprecision(17); double d = 0.1; cout << d << endl; return 0; }
Q4
What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int a = 8; cout << "ANDing integer 'a' with 'true' :" << (a && true); return 0; }
Q5
What will be the output of the following C++ code? #include <stdio.h> int main() { char a = '\012'; printf("%d", a); return 0; }
Q6
What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { enum channel {star, sony, zee}; enum symbol {hash, star}; int i = 0; for (i = star; i <= zee; i++) { printf("%d ", i); } return 0; }
Q7
What will be the output of the following C++ code? #include <iostream> using namespace std; int f(int p, int q) { if (p > q) return p; else return q; } main() { int a = 5, b = 10; int k; bool x = true; bool y = f(a, b); k =((a * b) + (x + y)); cout << k; }
Q8
Which data type is used to represent the absence of parameters?
Q9
What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int num = 0x20 + 020 + 20; cout << sizeof(num)<<'\n'; return 0; }
Q10
What does '\a' escape code represent?
Q11
What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { float num1 = 1.1; double num2 = 1.1; if (num1 == num2) cout << "stanford"; else cout << "harvard"; return 0; }
Q12
Suppose in a hypothetical machine, the size of char is 32 bits. What would sizeof(char) return?
Q13
What will be the output of the following C++ code? #include <iostream> using namespace std; void addprint() { static int s = 1; s++; cout << s; } int main() { addprint(); addprint(); addprint(); return 0; }
Q14
Is bool a fundamental data type in C++?
Q15
When a language has the capability to produce new data type mean, it can be called as
Q16
What is the value of p in the following C++ code? #include <iostream> using namespace std; int main() { int p; bool a = true; bool b = false; int x = 10; int y = 5; p = ((x | y) + (a + b)); cout << p; return 0; }
Q17
What does the following statement mean? void a;
Q18
What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int i = 3; int l = i / -2; int k = i % -2; cout << l << k; return 0; }
Q19
What will happen when defining the enumerated type?
Q20
What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int a = 5; float b; cout << sizeof(++a + b); cout << a; return 0; }
Q21
What constant defined in <climits> header returns the number of bits in a char?
Q22
Which of the given statements are false i. extern int func; ii. extern int func2(int,int); iii. int func2(int,int); iv. extern class foo;
Q23
How do we represent a wide character of the form wchar_t?
Q24
Which of the following will not return a value?
Q25
Which of these expressions will return true if the input integer v is a power of two?