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]
2 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]2 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
Encryption relies on the use of _________to ensure that information is readable only by the intended recipient.
stich3 [128]

Answer:

Encryption Keys

Explanation:

In order to make sure only the intended recipient receives the information, encryption keys rely on a unique pattern, just like your house key, except instead of grooves and ridges encryption keys use numbers and letters.

4 0
3 years ago
In 2011 a program named Watson running on an IBM supercomputer
lora16 [44]

Answer:C)Defeated the two most successful human Jeopardy! champions in a three-game match.

Explanation:  Watson emerged from the IBM supercomputer made by Thomas Watson .It is made from the two main component analytical software and the artificial intelligence which made it a optimal for the question-answer feature.

Watson defeated Ken Jennings and Brad Rutter(earlier successful contestants) in the program named Jeopardy by answering questions correctly and quickly in 2011.Other options are incorrect because it did not worked as the software engineer,humane genome or won crossword puzzle.Thus the correct option is option (c).

8 0
2 years ago
Blurring in a photograph can be due to _____ or ______.
scoray [572]
Do you have options? In my personal opinion, however, blur could be caused by motion blur, or focusing on the wrong thing, Hope this helps any!
4 0
2 years ago
Read 2 more answers
Mrs. Patel uses a computer program to balance her checkbook. Which of the following best explains how the
Alexandra [31]

Answer:

c it reduces errors

Explanation:

Instead of Mrs.Patel doing it she has an online program made for checks to do it for her.

6 0
3 years ago
What is meant by algorithm?​
ExtremeBDS [4]

Answer:

a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.

Explanation:

7 0
3 years ago
Other questions:
  • A Web ____ is a software program that retrieves the page and displays it. Select one:
    5·1 answer
  • A customer in a store is purchasing 5 items. Write a python program that asks for the price of each item and display the subtota
    14·1 answer
  • Self contained sequences of actions to be performed are?
    6·1 answer
  • Which network component is used to connect one network to another? Which component delivers the message to the destination compu
    5·1 answer
  • Ok.,so i have a sopitify account and by accident i pressed the downlaod on button and it says start you free trial i pressed tha
    11·2 answers
  • Kelly wants to change the text in a cell so that it is centered instead of left-aligned, where should she look to make this
    8·1 answer
  • All banks follow the same guideline for determining if an applicant qualifies for a loan.
    13·1 answer
  • Using C, Write a program that reads a series of strings from standard input and prints only those strings beginning with the let
    8·1 answer
  • Text,Audio and graphic is entered into the computer using
    9·1 answer
  • What is cloud computing?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!