1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
N76 [4]
3 years ago
6

Write a loop that fills an array int values[10] with ten random numbers between 1 and 100. Write code for two nested loops that

fill values with ten different random numbers between 1 and 100.
Computers and Technology
1 answer:
zalisa [80]3 years ago
7 0

Answer:

#include <iostream>

#include <cstdlib>

using namespace std;

int main() {

   int[] array = new int[10];

   int index = 0;

   while(index < array.size()){

           int number = (rand() % 100) + 1;

           for (int i = 0; i < 1; i++) {

               array[index] = number;

               cout<< "Position "<< index << "of the array = "<< number << endl;

               ++index;

           }

     }

}

Explanation:

The while loop in the source code loops over a set of code ten times, The for loop only loops once to add the generated random number between 1 and 100 to the array of size 10. At the end of the for loop, the index location and the item of the array is printed out on the screen. The random number is generated from the 'rand()' function of the C++ standard library.

You might be interested in
Which magazine loved their alienware test pc so much they didn't want to send it back?
dolphi86 [110]
Here is the answer. The magazine that loved their alienware test PC so much that they didn't want to send it back is the BOOT MAGAZINE, which is now known as MAXIMUM PC. This is based on one of the questions given by the Alienware <span>Arena Holiday Exam Scavenger Hunt Giveaway. Hope this answers your question.</span>
8 0
4 years ago
What network monitoring technology enables a switch to copy and forward traffic sent and received on multiple interfaces out ano
Afina-wow [57]

Answer: Port mirroring

Explanation: Port mirroring is the process through which the network packets are copied and transmitted port to port device as an input. It can carry the data in the form of network packets and then switch by coping the sending the data. This technique is implemented on the switches,computers and other networking devices for the monitoring and analysis process.

5 0
3 years ago
What's a good show to watch on Netflix?
AysviL [449]

Kengan Ashura and Umbrella Academy are two of my fav shows on Netflix

6 0
4 years ago
* Describe the five components of a<br> computer
LenaWriter [7]

Answer:

Computer systems consist of three components as shown in below image: Central Processing Unit, Input devices and Output devices. Input devices provide data input to processor, which processes data and generates useful information that's displayed to the user through output devices. This is stored in computer's memory.

5 0
2 years ago
Read 2 more answers
The IBM nine-track tapes that became the industry standard for storage for three decades had several sizes , the most common bei
sergey [27]

Answer:

5 MB.

Explanation:

1 foot = 12 inches

2400/9=266.66 feet per track

1 track excluding, remaining 8 track =2400 - 266.66 = 2133.33 feet

so, space available to store data = 2133.33 feet

now, 2133.33 feet = 25600 inches

total data that can be stored = 25600 * 1600 = 40960000 bits

= 46080000/8 = 5120000 Bytes

= 5120000/1000000 = 5.12 MB = 5 MB (approx.)

3 0
3 years ago
Other questions:
  • What's the problem with this code ?
    14·1 answer
  • One of the network printers is producing copies where the toner is smeared on paper after printing. What component should be che
    11·1 answer
  • Analyze the following code:
    8·1 answer
  • A document that summarizes your employment history and qualifications
    9·1 answer
  • 2min speech on can teachers be replace by technology​
    5·1 answer
  • You are to write a program name matrix.java that multiplies two matrices. 1. Your program should prompt the user for the dimensi
    5·1 answer
  • Sara Beth and Taylor have developed a new software that they plan to distribute for free, allowing other software professionals
    7·1 answer
  • The action displayed in the status bar while pointing-
    7·1 answer
  • HELP ME ILL GIVE BRAINLY Input 50 numbers and then output the average of the negative numbers only. Write in pseudocode!
    11·1 answer
  • What is the main coding language for netflix?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!