Important Questions

CBSE Guess > Papers > Important Questions > Class XII > 2010 > Computer Science > Computer Science By Ravi Kiran

CBSE CLASS XII

(c) void QUEUE::DELETE()
{
if (Front!=NULL)
{
Node *Temp=Front;
Cout<<Temp->U<<Temp->V<<endl; //Ignore
Front=Front->Link;
delete Temp;
if (Front==NULL) Rear=NULL; //Ignore
}
else
cout<<"Queue is Empty"<<endl; //Ignore
}

(d) void Div3or5(int A[][3],int N,int M)
{
int Sum=0;
for (int I=0;I<N;I++)
for (int J=0;J<M;J++)
if (A[I][J]%3==0 || A[I][J]%5==0)
Sum+=A[I][J];
cout<<Sum; //Ignore
}

OR

int Div3or5(int A[ ][3],int N,int M)
{
int Sum=0;
for (int I=0;I<N;I++)
for (int J=0;J<M;J++)
if (A[I][J]%3==0 || A[I][J]%5==0)
Sum+=A[I][J];
return Sum; //Ignore
}
OR
Any other equivalent code

4. (a) File.seekp((Recordsread-1)*sizeof(OM));

File.seekp(file.tellg()-sizeof(OM));

OR

Any other equivalent
Note : sizeof(OM) OR sizeof(Member) OR sizeof(NEW)are equivalents

(b) void COUNTALINES() //Ignore
{
ifstream FILE(“STORY.TXT”);
int CA=0;
char LINE[80];
while (FILE.getline (LINE,80))
if (LINE[0]!=’A’)
CA++;
cout<<”Not Starting with A counts to “<<CA<<endl;
FILE.close(); //Ignore
}

(c) void READAPPLY() //Ignore
{
fstream FILE;
FILE.open(“APPLY.DAT”,ios::binary|ios::in);
Applicant A;
while (FILE.read((char*)&A,sizeof(A)))
if (A.ReturnScore()<70)
A.Status();
FILE.close(); //Ignore
}

Paper By Mr. Ravi Kiran
Email Id : [email protected]