You are on page 1of 3

Board Practice Paper  

       set 4                         (2011)


Q.1.
a. What is the function of #define and “typedef” keyword ? Give an example 2
b. Conio, stdlib 1
c. Rewrite the following program after removing all syntactical error(s), if any. Underline each 2
correction.
#include<iostream.h>
int main()
{ structure student
{
int. rno, mark;
}stu;
student stuA= (1001,49);
student stuB= stuA;
if (stuA!= stuB)
stuA.mark= 55;
else
stuB.mark= 25;
cout<<stuA.mark<<stub.mark;
}
d. 110*56* 3
32*26*33
e. 2008#75 2
2009#100
f. The winner is : B6767 2
Q.2.
a. A non-member function always appears outside of a class. 2

Another difference between member functions and non-member functions is how they
are called (or invoked) in the main routine.
Ex :
int main()
{
int i;
myarray a; //declare a myarray object

i=myfunction(3,2); //invoking the non-member function


i=a.myfunction(3,2); //invoking the member function
}
b. i) Maths obj(45,”abc”); 2

Maths obj1(obj)

ii) Using the objects obj and obj1 we have to call the member functions

c. Do it yourself 4
d. (i) data members : read, show, print data, reading, read data , printing 4
(ii) multilevel
(iii) data membersfabric, cost stock , manufacturer,
Member functions : read , read data, reading , show , print data, printing
(iv) 42 bytes
Q3.
a. Do it yourself 3

b. Follow the method I have done n set 2 3


c. #include <iostream.h> 4
struct node
{
int x;
node *next;
};

class queue
{
node *rear, *front;
public:
queue()
{
rear =front = NULL;
}
void ins();
void del();
};

void queue::ins()
{
node *temp;
temp = new node;
if (temp==NULL)
{
cout << "No memory!";
return -1;
}
cout << "enter elements\n\n";
cin >> temp->x ;
temp->next=NULL;
if (rear==NULL)
{
rear=front=temp;
}
else
{
rear->next=temp;
rear=temp;
}
}
void queue::del()
{
if (f==NULL)
{
cout << "queue empty!";
return;
}
front = front->next;
}

d. Do it yourself 2
e. true 2
Q.4.
a. What is the purpose of seekp() and seekg( ) 1
b. void main() 2
{ fstream fin;
fin.open("text1.txt",ios::in);
if (!fin)
cout<<”File not found”;
else
cout << sizeof("text1.txt");
}
c. Do it yourself 3
Q.5.
a. 2
b.
6.
a. 2
b. (AC)’+(AB)’+(BC)’ 2
c. 1
d. 3
7.
a.
b.
c.
d.
e.
f.
g.

You might also like