Online Test for C++

  1. ________ is a default access specifier for members of structures in C++.
    protected
    public
    private
    default

  1. What features make C++ so powerful?
    Easy implementation
    Code reusability
    Easy memory management
    All the above


  1. Which of the following mode declaration is used in C++ to open a file for input?
    ios :: app
    in :: ios
    ios :: in
    ios :: file

  1. Which of the following operators can not be overloaded in C+ +?
    *
    ==
    +=
    ::

  1. The parameter list in function overloading must differ by?
    Number of functions
    Function Size
    Function Name
    Number of argument

  1. The Object is not declared for which class?
    Parent
    Base
    Abstract
    Derived


  1. If class A inherits from class B, then B is called _______ of A. A is called ________ of B.
    Super class, Sub class
    Subclass, Super class
    Abstract class, Base Class
    Child class, Sub Class

  1. C++ actually supports the following two complete dynamic systems?
    One defined by C++ and the other not defined by C
    One defined by C and one specific to C++
    Both are specific to C++
    Both of them are improvements of C

  1. Local Variables can be access ?
    Code block enclosed in braces { }.
    Code block enclosed in bracket ().
    Code block enclosed in square bracket [].
    None of the above

  1. Find Error/Output in follwing code:
  2.                                 
    #include <iostream>  
    
    using namespace std;  

    void square (int *x)  {
        *x = (*x)++ * (*x);  


    void square (int *x, int *y) {
        *x = (*x) * --(*y); 


    int main ( ) {
        int number = 30;          
        square(&number, &number);           
        cout << number;           
        return 0;  
    }
    910
    920
    870
    900

Post Your Question
Social Sharing
Search