GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
174 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.6k points)   | 174 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 Loyal (2.7k points)  


Top Users Jul 2017
  1. Bikram

    3782 Points

  2. manu00x

    2464 Points

  3. Debashish Deka

    1832 Points

  4. joshi_nitish

    1494 Points

  5. Arnab Bhadra

    1096 Points

  6. Arjun

    1054 Points

  7. Hemant Parihar

    1050 Points

  8. Shubhanshu

    972 Points

  9. Ahwan

    876 Points

  10. akash.dinkar12

    642 Points


23,953 questions
30,895 answers
70,108 comments
29,272 users