Question: Given two numbers X and Y = y _ ( 3 ) * 1 0 ^ ( 3 ) + y _ ( 2 )

Given two numbers X and Y = y_(3)*10^(3)+ y_(2)*10^(2)+ y_(1)*10+ y_(0), the product P = y_(0)* X can be expressed as P = y_(0)* X *10^(0)+ y_(1)* X *10^(1)+ y_(2)* X *10^(2)+ y_(3)* X*10^(3).
Which of the following algorithms compute P? Mark all that apply.
a.
A =0; B = X;
for i in 0 to 3 loop
A = A + y(i)*B;
B = B*10;
end loop;
P = A;
b.
P =0; A = X;
for i in 0 to 2 loop
P = P + y(i)*A;
A = A*10;
end loop;
P = P + y(3)*A;
c.
A = X;
for i in 0 to 2 loop
P = P + y(i)*A;
A = A*10;
end loop;
P = P + y(3)*A;
 Given two numbers X and Y = y_(3)*10^(3)+ y_(2)*10^(2)+ y_(1)*10+ y_(0),

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!