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
dimaraw [331]
3 years ago
10

Using the constant, declare a 1D array to store 10 integers ii. Write a loop that fills the array with 10 random numbers g

Computers and Technology
1 answer:
Airida [17]3 years ago
5 0

Answer:

Following are the code to this question:

#include <iostream>//defining header file

#include <cstdlib>//defining header file

using namespace std;

int main()//defining main method

{

const int ax[10]={1,2,3,4,5,6,7,8,9,10};//defining a const array ax that store 10 numbers

int r_num[10];//defining an array r_num

int i;//defining integer variable

for(i=0;i<10;i++)//defining for loop to calculate and store random numbers in array

{

   r_num[i]=rand()%100; //use rand function to store value in array

}

cout<<"Elements of the array that stores 10 random numbers: "<<endl;//print message

for(i=0;i<10;i++)//defining for loop for print array value

{

   cout<<r_num[i]<<endl;//print array value

}

return 0;

}

Output:

Elements of the array that stores 10 random numbers:  

83

86

77

15

93

35

86

92

49

21

Explanation:

In the above-given program, two arrays "ax, and r_num" is declared that store value in it, in which the ax array use the const keyword and in the r_num it uses the loop and random function which can be defined as follows:

In the second array "r_num", two for loop is declared, in which the first loop uses the rand function to store value in the array, and in the second array, it prints the value of the array.

You might be interested in
Each type of text has a purpose for the reader if you were looking to research penguins what type of text would u utilize
dlinn [17]
1. ughhhh not entirely sure but B, 2. again not entirely sure should be B as well and finally 3.is D remember these are not always the answer just most likely what one person thinks
3 0
3 years ago
In the Northern Hemisphere, large south-facing windows receive more total sunlight during the day and would be a part of a ___ s
9966 [12]

Answer:

Passive solar heating system

Explanation:

The goal of passive solar heating systems usually refers to the system in which the energy provided by the sun is used for heating and cooling of the living places in a house.

When sunlight falls on the house, the building elements capture the heat energy of the sun and it later releases back this heat when the sun is not there. The main objective of this system is to regulate the room temperature. It is comprised of two main elements, one is the glasses that face towards the south and a thermal mass that is used for heat absorption, storing and distribution of heat.

6 0
3 years ago
Which of the following statements are TRUE about credit cards? I. When you use a credit card, the money comes directly out of yo
Svetllana [295]

i think it is 1. becuase it can be.

4 0
3 years ago
What is hyperlink and its used in website
snow_tiger [21]

Explanation:

Hyperlink is the primary method used to navigate between webpages.

Hyperlink can redirect us to another webpages, such as websites that has graphics, files, sounds on the same webpage.

6 0
2 years ago
What element allows text to be displayed in italics, which means the words are slanted to the right?
Igoryamba

Answer:

the answer is the italic element

3 0
3 years ago
Other questions:
  • Programming CRe-type the code and fix any errors. The code should convert non-positive numbers to 1.
    12·1 answer
  • How do you activate the Formula AutoComplete function of Excel 2016?
    15·2 answers
  • To print a budget:________.
    9·1 answer
  • The function of an audio mixer is to _____. layer audio tracks at their ideal volume combine, control, and route audio signals f
    6·1 answer
  • Write a program that lets a maker of chips and salsa keep track of sales for five different types of salsa: mild, medium, sweet,
    14·1 answer
  • Please tell fast plzzzzzzzz​
    11·2 answers
  • 1.The hardware that allows data to be transmitted from a computer along a telephone line to another computer at the other end is
    12·1 answer
  • Who is the best valorant character
    11·2 answers
  • [2]<br> (c) Describe how the microprocessor can determine when to sound the clock alarm.
    6·1 answer
  • We initialize the parameters to all zero values and run the linear perceptron algorithm through these points in a particular ord
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!