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
Complete the sentence.
Galina-37 [17]
The answer is number 2 accessible
5 0
3 years ago
Give four example of computer virus​
asambeis [7]

trojan virus allows some one to sneak a bunch of coruppted data or more viruses into a system. a worm is able to access some ones computer and steal information a firebug is used to crash someones computer and spyder is used to scramble some ones work and deleting it

6 0
3 years ago
Describe the history of computer in Nepal.​
sergey [27]

Answer:

The first computer brought in Nepal was IBM 1401 which was brought by the government in lease for the population census of 1972 (2028 BS). Later in 1975 (2031 BS)YantrikSarinikaran Kendra (Electronic Data Processing Centre) was established which was later called as National Computer Centre ( NCC )

4 0
3 years ago
Read 2 more answers
.When one component modifies an internal data item in anothercomponent we call this:
Lady bird [3.3K]

Answer:

A. content coupling

Explanation:

When one component modifies an internal data item in another component we call this content coupling.

5 0
3 years ago
How many centimeters are there in 1 meters
konstantin123 [22]
1 meters is = 100 centimeters
8 0
3 years ago
Read 2 more answers
Other questions:
  • _____ learners prefer to interact with others on group projects.
    8·1 answer
  • Describe, step by step, how to create an account for a computer on the domain controller.
    11·1 answer
  • COMPUTER FUNDIMENTAL HELP 20 POINTS!!!
    5·1 answer
  • Which statement does NOT describe working with text in presentation programs?
    13·2 answers
  • Cost Benefit Analyses (CBAs) cannot be calculated after controls have been functioning for a time, as observation over time prev
    13·1 answer
  • Algorithms can be created in all the following ways EXCEPT:
    10·1 answer
  • 1. What was the very first “photo-realistic CGI character” to appear on-screen in a movie (released in 1985)?
    8·2 answers
  • Write instruction to recharge mobile phone ​
    5·2 answers
  • While organizing his computer's power cords, Matt realizes his printer power cord is frayed (coming apart). What should Matt do
    10·1 answer
  • What are the objectives of the computer communication with the surrounding world? ​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!