Question: Given double x = < any positive value less than 2003 >; which of the following code fragments set int y to the smallest integer

Given double x = < any positive value less than 2003 >; which of the following code fragments set int y to the smallest integer that is NOT less than three quarters of x? I. int y = (int)(3 * x / 4); if (y < 3 * x / 4) y++; II. int y = 1; while (y < 3 * x / 4) y++; III. int y = 2010 - (int)(2010 - x * 3 / 4);

(A) I only

(B) II only

(C) I and II

(D) I and III

(E) I, II, and III

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!