C++ Language | 10 Minute‐Test 9


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.

When a language has the capability to produce new data type mean, it can be called as

A.
overloaded
B.
extensible
C.
encapsulated
D.
reprehensible

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

Extensible is used to add new features to C++.

2.

Evaluate the following
(false && true) || false || true

A.
0
B.
1
C.
false
D.
none of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

none

3.

Which of these expressions will isolate the rightmost set bit?

A.
x = x & (~x)
B.
x = x ^ (~x)
C.
x = x & (-x)
D.
x = x ^ (-x)

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

None.

4.

Which of the following is illegal?

A.
int *ip;
B.
string s, *sp = 0;
C.
int i; double* dp = &i;
D.
int *pi = 0;

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

dp is initialized int value of i.

5.

Pick the right option
Statement 1:Global values are not initialized by the stream.
Statement 2:Local values are implicitly initialised to 0.

A.
Statement 1 is true, Statement 2 is false.v
B.
Statement 2 is true, Statement 1 is false.
C.
Both are false.
D.
Both are true .

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

Global values are implicitly initialised to 0, but local values have to be initialised by the system.

6.

Pick out the correct statement.

A.
virtual functions does not give the ability to write a templated function.
B.
virtual functions does not give the ability to rewrite a templated function.
C.
virtual functions does give the ability to write a templated function.
D.
none of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

None

7.

How many indicators are available in C ++ ?

A.
4
B.
3
C.
2
D.
1

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

There are three indicators are available in C++. They are Error indicator,
End-Of-File indicator and Position indicator.



8.

What will be used when terminating a structure ?

A.
:
B.
}
C.
;
D.
;;

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

While terminating a structure, a semi colon is used to end this up.

9.

What will be the output of this program ?

#include <stdio.h>

    using namespace std ;

    int main ()

    {

        int array[] = { 0 , 2 , 4, 6 , 7 , 5, 3 };

        int n, result = 0 ;

        for (n = 0 ; n < 8 ; n ++ ) {

            result + = array [ n] ;

        }

        cout << result ;

        return 0;

    }

 

A.
25
B.
26
C.
27
D.
none of the above

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

We are adding all the elements in the array and printing it. Total elements in the array is 7,
but our for loop will go beyond 7 and add a garbage value.




10.

Which of the following advantages we lose by using multiple inheritance ?

A.
Dynamic binding
B.
Polymorphism
C.
Both a & b
D.
None of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

The benefit of dynamic binding and polymorphism is that they help making the code
easier to extend but by multiple inheritance it makes harder to track.

Submit your test now to view the Results and Statistics with answer explanation.