GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
152 views

 

 

Fill in the blanks

Consider the $SDTS$ below

$E1\rightarrow E \ out (*2)$

$E \rightarrow +T \ out('1')$

$E \rightarrow T \ out (10^*)$

$E \rightarrow T*F \ out ( ' * ' )$

$T \rightarrow F \ out ('100+')$

$F \rightarrow num \ out (num \ val)$

The input is $1+1*1$ and the output generated is evaluated as an arithmetic expression . The value obtained is _____________.

Ans =2200

 

  correct ans 2212


I am not getting the answer, plz help. [SDT tracing by default is left-recursive, right??]

 

 

 

asked in Compiler Design by Loyal (2.5k points)   | 152 views
m getting 100102 ..
i got this 1100+10*100+1*1*2

@ sayantan  -    1100 + 10 * 1100 + 1 * 1 * 2

       Can U retry..

Yes. i am also getting the same!! 1100 + 10 * 1100 + 1 * 1 * 2

@Amsar i checked already,twice..nly it will come.but dont know how calculate the result,means by following bodmas or something else

1 Answer

0 votes

Got 1100+10*1100+1*1*2

which is equal to 12102 and is the correct answer.

answered by Junior (699 points)  


Top Users Mar 2017
  1. rude

    5118 Points

  2. sh!va

    3054 Points

  3. Rahul Jain25

    2920 Points

  4. Kapil

    2730 Points

  5. Debashish Deka

    2602 Points

  6. 2018

    1574 Points

  7. Vignesh Sekar

    1422 Points

  8. Akriti sood

    1382 Points

  9. Bikram

    1350 Points

  10. Sanjay Sharma

    1128 Points

Monthly Topper: Rs. 500 gift card

21,531 questions
26,861 answers
61,191 comments
23,206 users