Define an array with size elements of type double and


Question: Follow the instructions below regarding an array called fractions.

a) Define a symbolic constant SIZE to be replaced with the replacement text 10.

b) Define an array with SIZE elements of type double and initialize the elements to 0.

c) Refer to array element 4.

d) Assign the value 1.667 to array element nine.

e) Assign the value 3.333 to the seventh element of the array.

f) Print array elements 6 and 9 with two digits of precision to the right of the decimal point, and show the output that's displayed on the screen.

g) Print all the elements of the array, using a for repetition statement. Assume the integer variable x has been defined as a control variable for the loop. Show the output.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Define an array with size elements of type double and
Reference No:- TGS02404083

Now Priced at $15 (50% Discount)

Recommended (91%)

Rated (4.3/5)