GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
137 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)   | 137 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

Please log in or register to answer this question.

Top Users Feb 2017
  1. Arjun

    5396 Points

  2. Bikram

    4230 Points

  3. Habibkhan

    3952 Points

  4. Aboveallplayer

    3086 Points

  5. Debashish Deka

    2564 Points

  6. sriv_shubham

    2318 Points

  7. Smriti012

    2240 Points

  8. Arnabi

    2008 Points

  9. mcjoshi

    1696 Points

  10. sh!va

    1684 Points

Monthly Topper: Rs. 500 gift card

20,863 questions
26,023 answers
59,698 comments
22,136 users