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
What is an antispamming approach where the receiving computer launches a return attack against the spammer, sending email messag
Burka [1]

Answer:

Teergrubing.

Explanation:

Teergrubing is an antis-pamming approach where the receiving computer launches a return attack against the spammer, sending email messages back to the computer that originated the suspected spam.

It is a good antis-pamming approach because it slows response to the Simple Mail Transfer Protocol (SMTP) commands, thus tying up resources.

8 0
3 years ago
Read 2 more answers
Canadian Tire is one of Canada’s largest companies. They operate four large distribution centers service over 470 tire retail ou
olganol [36]

Answer: Provided in the explanation section

Explanation:

A YMS acts an interface between a WMS and TMS.The evaluation system with the key performance indicators are mentioned in the table below.

NOTE: The analysis follows in this order given below

  • Metric
  • Description
  • Comments

Metric 1

<u>Trailer utilization</u>

Description :This captures the status of the trailer whether it is in the yard or is in transit

Comments : Helps in measuring the trailer productivity on a daily ,weekly or monthly basis

Metric 2

<u>Driver utilization</u>

Description : This captures the status of the driver whether the driver is in the yard or is in transit

Comments : Helps in measuring the driver productivity on a periodic basis

Metric 3

<u>Trailer sequence</u>

Description : This captures the order of movement of trailers in the yard on a given day, week or month

Comments : Helps in measuring the order fulfilment efficiency i.e. whether the priority orders have been serviced first or not

Metric 4

<u>Total time in yard</u>

Description : This captures the time spent by the trailer in the yard from the time it enters and leaves the yard

Comments : This helps in measuring the time taken to fulfill a particular request

⇒ Capturing these metrics need inputs from both WMS and TMS, and also the trailers need to have RFID tags attached to them.Then compare these performance metrics with the ones prior to the deployment of YMS to identify the percent gains in the overall operational productivity.

cheers i hope this helped !!

8 0
3 years ago
How can a CRM system help communicate issues in the supply chain between customers and drones?
riadik2000 [5.3K]

Answer:

CRM system can help customers about the service supplied.  

Explanation:

CRM stands for Customer Relationship Management and CRM system is a useful tool for communicating with customers.

CRM can keep the data about the order provided by the customer and has updated info about its status.

For example, if the customer of a logistics company wants to know where his/her order is, customer represantative can give up-to-date info about the order where abouts. Or the customer directly uses web to check the status of the order.

All these service can be provided by a CRM system, since drones can send its location to CRM systems.

8 0
2 years ago
The engine flywheel bolts to the Rotor Pistons Front axle Crankshaft
swat32
The answer is D. Crankshaft.  The flywheel is connected to the crankshaft. The crankshaft<span> is </span>connected<span> to the pistons and moves in a circular motion to move the engine. Spark Plugs are based at the top of the pistons, this is used to ignite fuel in the pistons that move them. The timing belt is </span>connected to the crankshaft<span> and it rotates the camshaft. </span>
5 0
3 years ago
Arnie is planning an action shot and wants the camera to move smoothly alongside his running characters. He is working on a tigh
cricket20 [7]
Camera and wagon are answer
4 0
2 years ago
Other questions:
  • Which of the following correctly describes the function of an IP address?
    7·1 answer
  • Pretrial services programs are also known as early intervention programs. <br> a. True <br> b. False
    15·1 answer
  • Jim is in the market for a car that will last for the next 10 years and has saved up some money for the purpose of a car. What’s
    6·1 answer
  • The overall purpose of a food guide is________.
    11·1 answer
  • Computing devices translate digital to analog information in order to process the information
    8·1 answer
  • An example of an electrical insulator is _____.
    15·1 answer
  • Assume that name and age have been declared suitably for storing names (like "abdullah", "alexandra" and "zoe") and ages respect
    14·1 answer
  • I'd: 9872093250, password: qqqqq, join the meeting​
    11·1 answer
  • Which one causes concerns for institutions or businesses when they are collected stores and they aren’t secured properly?
    5·1 answer
  • Which digital cellular standard is used widely throughout the world except the united states?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!