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

Consider the following expressions which calculates one solution of the quadratic equation:
ax2+bx+c=0

x=(b+sqrt(b24×a×c))/(2×a)

where sqrt is an unary operator which performs the square root.The least number of temporary variables required to create a three address code in static single assignment form for the above expression is ________?

  1. 8

Open in App
Solution

The correct option is A 8
We will need a temporary variable for storing the result
(Static Single Assignment) implies the variable cannot
t1=b * b
t2=4 * a
t3=t2 * c
t4=t1 * t3
t5=sqrt(t4)
t6=t5 * b
t7=2 * a
t8=t7/t8
x=t8

Here temporary variable = 8


flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Introduction
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon