CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
6
You visited us 6 times! Enjoying our articles? Unlock Full Access!
Question

Consider the translation scheme shown below:
ST R
R+T {print (+);} R | ϵ
T num {print (num.val);}

Here num is a token that represents an integer and num.val represents the corresponding integer value. For an input string '9 + 5 + 2', this translation scheme will print

A
9 5 + 2 +
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
9 + 5 + 2
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
+ + 9 5 2
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
9 5 2 + +
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is A 9 5 + 2 +
For the input '9 + 5 + 2' the translation scheme is 95 + 2 + shown below:

flag
Suggest Corrections
thumbs-up
0
similar_icon
Similar questions
View More
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Putting It Together - BODMAS
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon