Question: Use the code attached to this question as a template to start working in your solution. Declare an array that can hold 10 integer numbers.
- Use the code attached to this question as a template to start working in your solution.
-
Declare an array that can hold 10 integer numbers.
The template code provided already has a for loop that generates 10 random integer numbers, use that for loop to fill up the array using those random numbers. - Print all the numbers in the array to the screen, separated by a comma.
Remember that the numbers are random so you will never get these exact same numbers when you execute your code!!!!!!
code
#include#include #include // Enables use of time() /*************** ***************/ int main(void) { int i, number; srand((int)time(0)); // Unique seed for (i=0; i<10 ;i++) { number = (rand()%100)+1; printf("%d ", number); } printf(" "); return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
