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
State one advantage of organising data into columns and rows
Bezzdna [24]
It's neat organized and ready to find when needed
6 0
3 years ago
Which part of the website address is its top-level domain name?
mr Goodwill [35]
The top-level domain is usually .com, .org, .net, and many more.
4 0
3 years ago
Hidden-surface removal is the process of:
castortr0y [4]

Answer:

Option A.

Explanation:

In 3D computer graphics, this process determines which elements should not be visible from the desired point of view, and will prevent them from rendering. Thus, objects that lie behind opaque surfaces such as walls or panels, will not be rendered.

A good rendering algorithm helps to optimize the graphic engine because it will load as few elements as possible. Therefore, in larger worlds, the engine will remain at a stable speed and will be more efficient.

3 0
3 years ago
A ________ infrastructure is a framework that consists of programs, procedures,and security policies and employs public key cryp
Norma-Jean [14]

Answer:

The answer is "Public Key".

Explanation:

PKI stands for public key infrastructure. It is a collection of functions, protocols, equipment, code, and procedures that require to create, maintain, transmit, store and cancel encrypted certs and handle the authentication of a public key.  

  • It is used to sign documents digitally.
  • It works for propagating with Trojans and other malware.
5 0
3 years ago
Your trying to convince your school that brainly.com is the most effective method to a good tutor and A quick responding site, H
viktelen [127]
I would agree with that Brainly.com is a good place if you need help with homework.
6 0
3 years ago
Other questions:
  • When naming a file you should use the _____________ instead of a space in a filename.
    6·1 answer
  • Why might your digital footprint be important when you are applying for collage
    13·1 answer
  • Robin ensures that she is always available if anyone in the team needs her. Which quality is shown by robin?
    9·2 answers
  • Tools, documents, language and processes—these are examples of boundary objects. Which of the following is the best definition o
    11·1 answer
  • Universal Containers needs the ability to generate contract documents. All the data required for a contract resides in a custom
    6·1 answer
  • A(n) _________ is any system resource that is placed onto a functional system but has no normal use for that system. If it attra
    15·1 answer
  • Help me I'm so confused by this question
    7·1 answer
  • What is also known as computer Network?
    6·2 answers
  • A well-known production is making a documentary film titled “The Dwindling Population of Grizzly Bears in the United States.” Wh
    5·1 answer
  • Viruses and Malware Complete the case project on page 82 of the textbook by researching two types of viruses, two types of malwa
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!