New ! Computer Science MCQ Practise Tests



11th Standard English Medium Computer Science Subject Classes and objects Creative 2 Mark Questions with Solution Part - II

11th Standard

    Reg.No. :
  •  
  •  
  •  
  •  
  •  
  •  

Computer Science

Time : 01:00:00 Hrs
Total Marks : 10

    2 Marks

    5 x 2 = 10
  1. Why classes are needed in C++?

  2. What is access specifies?

  3. When the memory space allocated to the class members?

  4. Write the significance of Default constructors.

  5. What will be the output of the following program?
    # include < iostream >
    # include < conio >
    using namespace std
    class add          //Global class
    {
    int a,b;
    public:
    int sum;
    void getdata( )
    {
    a=5;
    b=10;
    sum = a+b;
    }
    } a1;             //globalobject
    add a2; ,      //globalobject
    int main( )
    {
    add a3;        //Local object for a global class
    a1.getdata ( );
    a2.getdata( );
    a3.getdata( );
    cout < < a1.sum;  //public data member accessed from outside the class
    cout < < a2.sum;
    cout < < a3.sum;
    return 0;
    }

*****************************************

Reviews & Comments about 11th Standard English Medium Computer Science Subject Classes and objects Creative 2 Mark Questions with Solution Part - II updated Creative Questions

Write your Comment