The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+1 vote
202 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.9k points) | 202 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 Veteran (11.2k points)


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

28,947 questions
36,793 answers
91,077 comments
34,690 users