Write a main function that declares an array of 100 doubles. In a for loop, assign each of the doubles a random number between 0.50 and 50.00. Here’s how.
    Write a main function that declares an array of 100 doubles. In a for loop, assign each of the doubles a random number between 0.50 and 50.00. Here’s how.

Write a main function that declares an array of 100 doubles. In a for loop, assign each of the doubles a random number between 0.50 and 50.00. Here’s how.

$10.00

Write a main function that declares an array of 100 doubles. In a for loop, assign each of the doubles a random number between 0.50 and 50.00. Here’s how.

  array[i] = (double) (rand() % 100 + 1) / 2.0;

Output the elements of the array in 10 columns that are each 6 spaces wide.   

Each row in the output will have 10 values. The doubles will be printed with 2 places of accuracy past the decimal.

The output of this one-dimensional array requires a single loop with an if statement inside. Even though the 100 numbers are going to be presented as a table of numbers, they are still just a list in memory.

Submit the .c  file or copy and paste the program with the proper indentation

A++ solution for this question

Solution contain C program.

Attached Files

Move over [ preview ] file name to preview content in it!

  • Array.zip [0.4KB]
    • Array.c [0.4KB] [ preview ]

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



Tags: C
PURCHASE SAVE
2 Tutorials 10%
3 Tutorials 13%
4 Tutorials 16%
5 Tutorials 19%
6 Tutorials 22%
7 Tutorials 25%
8 Tutorials 28%
9 Tutorials 31%
10 Tutorials 34%
add url more

9MZQASHWN73B