Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab 4: Arrays, For Loops Instructions: Complete the following problems listed below using Ct+ programming. Include necessary comments to your code as needed. Part #1:
Lab 4: Arrays, For Loops Instructions: Complete the following problems listed below using Ct+ programming. Include necessary comments to your code as needed. Part #1: Write a program to fill a 10 element array of integers with random numbers that fall between 1 and 100. Note: Use srand(time(NULL)); once at the beginning of the program to seed the random number generator. Otherwise, you will generate the same set of random numbers each time. rand) generates a random number from 0 to something huge Be sure to use the following header files: . #includeccstdlib #include Tip: use rand() % 100 +1; to generate numbers from 1 to 10 Part #2: Modify your program to print the contents of the array using a loop
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started