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
Create a script that prompts for the user to input a directory and then prints out the number of sub-directories in the given di
laila [671]

Answer:

Below is the required code:

Explanation:

Python Code

import os

import bin

dir = input("Please specify the location to the directory")

list = os.walk(dir)

a = length(list[1])

b = length(list[2])

print "Files: %n , Sub-dirs : %n" % (b,a)

decision = _(" Do you want to continue? (y/n) "))

if(decision):

cls

else :

exit()

5 0
3 years ago
Crop marks are used on an illustration to indicate to the printer the
Advocard [28]
Crop marks are used on an illustration to indicate to the printer the A. center point of the illustration. Hope this helped!.
5 0
3 years ago
• What advantage does a circuit-switched network have over a packet-switched network? What advantages does TDM have over FDM in
lions [1.4K]

Answer:

Advantages of both circuit switched networks and TDM are given below:

Explanation:

Advantages of circuit switched network over packet switched network:

  • Circuit switched network has the advantage of being physically connected and having a dedicated channel for communication between the sender and the receiver which also makes it more reliable. Packet switched networks do not have a dedicated channel hence, they are not that reliable.
  • Circuit switched networks are used for voice calls because there is no timing jitter or delay in these types of networks while packet switched networks do not offer this advantage.

Advantages of TDM over FDM in a circuit switched network:

  • TDM is time division multiplexing i.e. multiple information is sent in different time intervals but on the same frequency. While FDM sends information using different frequencies. So, the advantage of using TDM is that the information will be sent from the sender to the receiver using only a single frequency.
  • Using TDM, bandwidth is saved because it only sends information on a single frequency unlike FDM.
  • In TDM, there is low chance of interference between signals since they are sent in different time intervals from the sender to the receiver. While FDM has a higher chance of interference.
4 0
3 years ago
Which option is an appropriate database function syntax?
kodGreya [7K]

Answer:

=DSUM(A4:D8, "Unit Cost", A1:B2)

Explanation:

From the list of given options, it's obvious that the question relates to Excel database sum function.

The correct answer among the list of options is:

=DSUM(A4:D8, "Unit Cost", A1:B2)

Where

DSUM represents the function itself

A4:D8 represents the range

"Unit cost" represents the field

and

A1:B2 represents the criteria of the function

Analysing other options:

Option 1: The equality sign (=) before excel formulas is missing

Option 2: Sum is used instead of DSUM and there's a missing bracket before the range

Option 3: There's a missing comma between the range, the field and the criteria

Hence, the last option (4) answers the question.

5 0
3 years ago
Read 2 more answers
The printing press helped spread the ideas of the Renaissance.<br> a. True <br> b. False
guajiro [1.7K]
The answer is a. True

The printing press did help spread the ideas of the Renaissance, as it could spread ideas easily, quickly, and in different languages.

6 0
4 years ago
Other questions:
  • When operating a computer, a user interacts with
    14·2 answers
  • so im thinking about building my own pc for a decent price can anyone point me to a website where i can buy the parts and name t
    13·2 answers
  • bj;ljfg'cfmb dfl kbslf jflk[gkdblkfd lbrkjlfbbfkjbdfjkbadbjbbkvbk'lbk'blbf;l;lkb lm;flklmkjlvkljvkljvbfbdsjsfbbjjlkbfjklbkfj'lgg
    9·2 answers
  • By default, after how much time has elapsed in a client's DHCP lease will the client attempt to renew the lease?
    12·1 answer
  • If you are interested in working for a specific company, what type of job site should you look at for opening?
    12·1 answer
  • Complete the function by filling in the missing parts. The color_translator function receives the name of a color, then prints i
    11·1 answer
  • Design a for loop that gets 6 integer numbers from a user, accumulates the total of them, then displays the accumulated total to
    9·1 answer
  • Sound technology has been influenced the most by the ___.
    5·2 answers
  • Who used the term" software" first?
    8·2 answers
  • 9) Which date is assigned the serial number of 1?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!