Professional Documents
Culture Documents
UNIT TEST NO : 1
MM : 40 TIME: 01:30hrs
Note: All the questions are compulsory.
Q No 2: Write the name of the header file to which the following belongs. 2
Q No 3: Write the name of the header file to which the following belongs. 2
Q no 4: Write the name of the header files, which is/are essentially required to run/execute the
void main()
for(int i=0;Text[ip!=’\0’,i++)
if(text[i]==’ ‘)
cout<<endl;
else
CH= toupper(text[i]);
cout<<CH; }
ii) 1
iii) 2
#include<iostream.h>
int main()
{ int f=1,i=2;
Do { f *=I;
cout<<f;
return 0;
Noofepisodes integer
(iii) Otherentries () function to assign the values of Duration and Noofepisodes with the
help of cin statement.
(iv) Dispdata () function to display all the data members on the screen.
class WORLD
{ private :
float A;
protected :
public:
};
class COUNTRY: public WORLD
{ long double D;
protected: long E;
public:
};
class STATE : private COUNTRY
{ private:
short F;
public:
void INSTATE( ); void OUTSTATE( ); };
Q No 8: What is the difference between constructor and destructor ? Give example of both. 4
Q No 9: Rewrite the following program after removing the systactical error(s) if any. 4
include <iostream.h>
Vid main()
float p1,p2,num;
p1=p2=0;
for(int x=0;x<11;x++)
{ cin<<num;
if(num>0) p1 += num;
else
p2 /= num; }
cout<<p1>>p2;
(i) Abstract class (ii) Concrete class (iii) Polymorphism (iv) Encapsulation
Q No 7: What is the difference between Type casting and automatic type conversion? Also give a