Instruction
- Total number of questions : 10.
- Time alloted : 10 minutes.
- Each question carry 1 mark.
- No Negative marks
- DO NOT refresh the page.
- All the best :-).
1. |
Which of the following statements are true? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: The argument that is passed to a function f is of float type and the function |
2. |
Which of the two operators ++ and — work for the bool datatype in C++ ? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: Due to history of using integer values as booleans, if an integer is used as a boolean, |
3. |
Which of these expressions will return true if the input integer v is a power of two? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: Power of two integers have a single set bit followed by unset bits. |
4. |
Choose the right option |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: * is to be grouped with the variables not the data types. |
5. |
Pick the right option |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: An identifier can be declared many times must be defined just once. |
6. |
Identify the type of the variables. |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: The statement makes CHAR a synonym for char*. |
7. |
What is the output of this program by manipulating the text file ? #include <stdio.h> int main () { if ( remove( "myfile.txt" ) ! = 0 ) perror( "Error" ) ; else puts( "Success" ) ; return 0 ; }
|
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: If myfile.txt exists, then it will delete the file. Else it will print an error message. |
8. |
What is the output of this program ? #include using namespace std ; void duplicate ( int & a, int & b, int & c ) { a * = 2 ; b * = 2 ; c * = 2 ; } int main () { int x = 1 , y = 3 , z = 7 ; duplicate ( x, y, z) ; cout << x << y << z; return 0; }
|
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: We are passing the values by reference and modified the data on the function block. |
9. |
Which of the following correctly declares an array ? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: Because array variable and values need to be declared after the datatype only. |
10. |
What is meant by multiple inheritance ? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: Multiple inheritance enables a derived class to inherit |