+ 8
Evaluate the following postfix notation of expression : False,true,not,or,true, false,and,or.
8 Respuestas
+ 9
(show status of stack after each operation)
The answer is FALSE but i need to know how?
this question is from my Cs book.
+ 8
Ok, thanks.
+ 2
:D
+ 1
can u write it in code.
I don't get it.....:)
+ 1
F, push, F
T, push, T
!, pop T !T is push F, FF
|| , pop 2 F or F = F push F, F
T, push, FT
F, push F, FTF
&&, pop2 T&F=F push F,FF
|| pop2 F or F = F push F, F
Uh I think but having a huge brain fart on this lol.
+ 1
you always push onto the stack or pop off. the logical operators use whats on the stack to get your next value. lifo last in first out. so take your values and run the logic operators through them. && || always require 2 args so pop last 2 and eval.
+ 1
False
true not (= false)
or (false or false= false)
true
false
and (true and false= false)
or (false or false= false)
0
Evaluate the following postfix expression. False , True, NOT,OR, True, False, AND,OR