![Important Questions](../../../../../images/headings/important_question.gif)
CBSE Guess > Papers > Important Questions > Class XII > 2010 > Computer Science > Computer Science By Ravi Kiran
CBSE CLASS XII
![](../../../../../images/next.gif)
//Ignore the following line while evaluation
cout<<Top->Bno<<Top->Bname<<”deleted”<<endl;
Top = Top ->Next;
delete Temp;
}
else
cout<<”Stack Empty”;
}
OR
void Pop(Book *&Top)
{
if(Top!=NULL)
{
Book *Temp = Top;
Top = Top ->Next;
delete Temp;
}
else
cout<<”Stack Empty”;
}
(d) void Diagonals(int Arr[][100], int Size)
{
int Row, Col;
cout<<”Diagonal One: “;
for (Row = 0; Row < Size; Row++)
for (Col = 0; Col < Size; Col++)
if (Row == Col)
cout<<Arr[Row][Col];
cout<<”Diagonal Two: “;
for (Row = 0; Row < Size; Row++)
for (Col = 0; Col < Size; Col++)
if (Row + Col == Size - 1)
cout<<Arr[Row][Col];
}
OR
void Diagonals(int Arr[][100], int Size)
{
int Loc;
cout<<”Diagonal One: “;
for (Loc = 0; Loc < Size; Loc++)
cout<<Arr[Loc][Loc];
cout<<”Diagonal Two: “;
for (Loc = 0; Loc < Size; Loc++)
cout<<Arr[Loc][Size-Loc-1];
}
(e) Operator Scanned Stack Content
25 25
8 25, 8
3 25, 8, 3
- 25, 5
/ 5
6 5, 6
* 30
10 30, 10
+ 40
OR
Any other method of correctly evaluating the postfix expression is shown.
![](../../../../../images/next.gif)
Paper By Mr. Ravi Kiran
Email Id : [email protected] |