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
vagabundo [1.1K]
3 years ago
13

Write a C program that stores N random numbers in an array named rA[ ] and determine the largest, smallest, and average values o

f this array. Display the array elements that store these values. The random numbers range from -50 to +50. N is a command line argument.
Computers and Technology
1 answer:
Aliun [14]3 years ago
4 0

Answer:

// program in C.

// headers

#include <stdio.h>

// headers

#include <stdlib.h>

// headers

#include <limits.h>

// main function

int main(int argc, char** argv)

{

   // read value of N from command line arguments

   int N=atoi(argv[1]);

   // variables

   int max=INT_MIN;

   // variable

   int min=INT_MAX;

int rA[N],i;

// fill the array with random number

for(i=0;i<N;i++)

{

    // generate random number from -50 to +50

    rA[i]=rand()%101-50;

    // find the Maximum

    if(rA[i]>max)

    max=rA[i];

    // find the Minimum

    if(rA[i]<min)

    min=rA[i];

}

// print values of array

printf("values of the array are:");

for(i=0;i<N;i++)

{

    printf("%d ",rA[i]);

}

// print Maximum

printf("\nMaximum value is:%d",max);

// print Minimum

printf("\nMinimum value is:%d",min);

return 0;

}

Explanation:

Read value of N from command line.Then create an array of size N.Fill the array with random number from -50 to +50.Then find the Maximum of all the elements and  assign it to variable "max" and find Minimum from all and assign it to variable "min". then print all the elements of the array, Minimum and Maximum.

Output:

command line argument=10

values of the array are:-18 -18 4 -38 2 6 -42 -20 -6 44 -6 -11 15 -31 1                                                    

Maximum value is:44                                                                                                        

Minimum value is:-42

You might be interested in
Como afecta la robotizacion en las empresas?
kirill [66]

Yo llamaria a esto automatizacion.

Puede reducir los costos al permitir que la empresa emplee a menos personas.

8 0
3 years ago
Consider the following sequence of items 10, 36, 25, 54, 37, 12, 75, 68, 42, 86, 72, 90. Insert these items in the order above,
AnnZ [28]

Answer:

See attachment below

Explanation:

5 0
3 years ago
In what way , if any, can your social media presence affect your chances of getting a job in social media?
____ [38]

Answer:

Your social media presence can affect your chances of getting a job anywhere, not only a job on social media.

Explanation:

Whatever you do online leaves a digital footprint. If you leave a bad digital footprint, it will be left there forever. This bad footprint could affect your chances of getting a job by setting a bad impression on the employers. The same could go for any good digital footprint you leave behind.

6 0
3 years ago
"which part of an information system consists of the rules or guidelines for people to follow?"
choli [55]
Procedures are part of the information system that consist of the rules or guidelines for people to follow. Procedures are one of the main components of the information system, together with the hardware, software, telecommunications, databases, data warehouses and human resources. The procedures are policies that specify the requirements and standards for operation of the computer.
3 0
3 years ago
Two technicians are discussing ASE certification. Technician A says that there are 60-plus exams each designed to discern the au
babunello [35]
TECHNICIAN B is the one who is right. ASE is and acronym for Automotive Service Excellence. ASE is a professional certification group which certified professionals in the automotive repair industry. To qualify to take their test, one must have at least two years on the job experience, because the exam questions are job related. There are 40 plus exams and each is designed to test the professionals' knowledge of job related skills.   
6 0
3 years ago
Read 2 more answers
Other questions:
  • Which structure is the following true for? For _________, the entire code is substituted for each call. Macros Both Macros and P
    14·1 answer
  • How to program chamberlain universal garage door opener?
    13·1 answer
  • List three uses of the INTERNET
    9·2 answers
  • A spreadsheet has some values entered:Cell A1 contains 10 cell A2 contains, cell A3 contains 7. you enter in cell A4 the followi
    14·2 answers
  • Some projectors use a connection technology called _______________ that enables long-range connectivity for uncompressed HD vide
    12·1 answer
  • What will Jason need to assemble a microcomputer and connect it to memory chips
    8·1 answer
  • Your friend Rebecca called because she is working on a budget and needs help with the AutoSum feature. She thinks AutoSum will b
    8·1 answer
  • In which direction streams can send data?
    15·1 answer
  • Kesley has been hired to set up a network for a large business with ten employees. Which of the factors below will be
    9·1 answer
  • True or false you can create a. network with 2 computers?<br>​
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!