The Total solution for NCERT class 6-12
Answer - 1 : -
ITEM SCANNED
OPERATION
STACK
2
PUSH 2
13
PUSH 13
2,13
+
POP 13 and 2 Evaluate 2 + 13 = 15 PUSH 15
15
5
PUSH 5
15,5
–
POP 5 & 15 EVALUATE 15-5 = 10 PUSH 10
10
6
PUSH 6
10, 6
3
PUSH 3
10, 6, 3
/
POP 3 & 6 EVALUATE 6/3= 2 PUSH 2
10,2
10, 2, 5
*
POP 5 & 2 EVALUATE 2*5 = 10 PUSH 10
10, 10
<
POP 10 & 10 EVALUATE 10<10 = FALSE PUSH FALSE
FALSE
RESULT = FALSE
Answer - 2 : -
ITEM
SCANNED
100
PUSH 100
40
PUSH 40
100,40
8
PUSH 8
100,40,8
POP 8 POP 40 EVALUATE 40/8 =5 PUSH 5
100,5
20
PUSH 20
100,5,20
PUSH 10
100, 5, 20, 10
POP 10 POP 20 EVALUATE 20-10 =10 PUSH 10
100,5,10
POP 10 POP 5 EVALUATE 10 + 5= 15 PUSH 15
100,15
POP 15 POP 100 EVALUATE 100 * 15 = 1500 PUSH 1500
1500
Answer - 3 : -
S.No.
Scanned Element
Operation
Stack
1
F
PUSH F
T
PUSH T
F,T
NOT
Calculate NOT T
POP T
F,F
4
AND
Calculate NOT
POP F
OR
7
Thus the stack willhave False Value
Answer - 4 : -
SYMBOL
OUTPUT
5,3
5,3,2
PUSH 3,2
Perform 3*2=6
POP 6
5,6
5,6,4
5,6,4,2
PUSH 4,2
Perform 4/2=2
POP2
5,6,2
PUSH 6,2
Perform 6-2=4
POP 4
5,4
PUSH 5,4
perform 5*4=20.
POP 20
Result=20
Answer - 5 : -
Element Scanned
Stack Status
False
True
True, True
True, True, False
Final Answer: True
Answer - 6 : -
Answer - 7 : -
Symbol
Scanned
Expression
(
X
((
((*
—
y
X-
z
)
Z
((* +
((* + *
((* + * +
((* + * + *
(/
(/(
(/(+
(+ +
(/(+ +
x3
x3y
x3y3
x3y3z
x3y3z3
x3y3z3 * + * + *
x3y3z3* + * + *
x3y3z3 * + * + * x
x3y3z3 * + * + * x •
x3y3z3 * + * + * x y
x3y3z3 * + * + * xyz
x3y3z3 * + * + * xyz + +
x3y3z3 * + * + * xyz + +/
\Postfix expression is: x3y3z3 * + * + * xyz ++/
Answer - 8 : -
45
45,45
90
32
90,32
90,32,20
90,32,20,10
90,32,2
90,30
2700
Hence the final resultis 2700
Answer - 9 : -
Answer - 10 : -