Originally posted by kashish verma:
Hi Jan,
Can u explain the last line of your reply.How would we calculate b1 from behind?
I understood for b3, but now output of b1 is confusing me.
Hi Kashish,
This is how it goes...
evaluation of b1 is straight and simple...moving right-to-left...since conditional operators have right-associativity i.e.. they are evaluated from right to left
b1 = false?false:true?false:true?false:true;
b1 = false?false:true?false:false;
b1 = false?false:false;
b1 = false;
Now coming to b2,
b2 = false?false

true?false

true?false:true));
again moving from right-to-left,
b2 = false?false

true?false:false);
b2 = false?false:false;
b2 = false;
and finally, b3
b3 = ((false?false:true)?false:true)?false:true);
This is a bracketed equation, so brackets take precedence over the precedence order.
so evaluating from innermost bracket,
b3 = ((true?false:true)?false:true)
= (false?false:true)
= true
So, b1 = false, b2 = false and b3 = true
Hence the function m1(false,false,true)...so the answer FFT
Hope this helps
[ December 12, 2005: Message edited by: Sherry Jacob ]