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
Arlecino [84]
3 years ago
6

Write analgorithm and a C code to calculate the sum and average value of an array12elements.For example: Array_Temperaure=[10, 1

2, 13, 15, 20, 23, 25, 25, 25, 16, 13, 10}

Engineering
1 answer:
Lerok [7]3 years ago
4 0

Answer:

The solution of this code is given below in explanation section.

Explanation:

The C code of this problem is given below

/*******************************************************************************/

#include <stdio.h>

int main()

{

   int n=12, i;//n show the elements in array, while i will be used in for loop

   float Array_Temperaure[]={10, 12, 13, 15, 20, 23, 25, 25, 25, 16, 13, 10};//Array_Temperaure declared and initialized  

   float sum = 0.0;// sum variable declared and initialized

   float avg;// avg average variable declared and initialized

   

   for (i = 0; i < 12; ++i) //for loop to iterate through elements in Array_Temperaure.

   {  

       

       sum += Array_Temperaure[i];// in sum vaiable, Array_Temperaure numbers are added

   }

   avg = sum / n;// average is calculated

   printf("Sum = %.2f", sum);// sum is shown

   printf("\nAverage = %.2f", avg);// average is desplayed.

   return 0;

}

/*************************************************************** algorithm******************/

declare array Array_Temperaure[12];

declare int variable n ,i;

declare float variable sum and average;

for loop

          To iterate n time

                    sum the number of array at current index into total sum

calculate average;

display sum;

display average;

terminate the program;

You might be interested in
Ughhh I feel so moody rn and I’m cramping so bad
padilas [110]
Explanation:!!

I hope you Feel better :)
3 0
3 years ago
Read 2 more answers
Water flows through a nozzle at the end of a fire hose. If the nozzle exit velocity must be 20 m/s and the exit diameter is 40 m
lara31 [8.8K]

Answer:

minimum flow rate provided by pump is 0.02513 m^3/s

Explanation:

Given data:

Exit velocity of nozzle = 20m/s

Exit diameter = 40 mm

We know that flow rate Q is given as

Q = A \times V

where A is Area

A =\frac{\pi}{4} \times (40\times 10^{-3})^2 = 1.256\times 10^{-3} m^2

Q = 1.256\times 10^{-3} \times 20 = 0.02513 m^3/s

minimum flow rate provided by pump is 0.02513 m^3/s

5 0
3 years ago
A continuous and aligned fiber-reinforced composite having a cross-sectional area of 1130 mm2is subjected to an external tensile
lakkis [162]

Answer:

(a)  The force sustained by the matrix phase is 1802.35 N

(b) The modulus of elasticity of the composite material in the longitudinal direction Ed is 53.7 GPa

(c) The moduli of elasticity for the fiber and matrix phases is 124.8 GPa and 2.2 GPa respectively

Explanation:

Find attachment for explanation

8 0
3 years ago
What are the main causes of injuries when using forklifts?
vagabundo [1.1K]

The forklift overturning is a very common way of getting injured from a forklift. Overturning the forklift means it tips over onto it's side due to the operator turning it too fast.

5 0
3 years ago
A gas enters a compressor that provides a pressure ratio (exit pressure to inlet pressure) equal to 8. If a gage indicates the g
olga55 [171]

Answer:

P_2_{abs}=160\ psia (absolute).

Explanation:

Given that

Pressure ratio r

r=8

r=\dfrac{P_2_{abs}}{P_1_{abs}}

  8=\dfrac{P_2_{abs}}{P_1_{abs}}                                  -----1

P₁(gauge) = 5.5 psig

We know that

Absolute pressure = Atmospheric pressure  + Gauge  pressure

Given that

Atmospheric pressure = 14.5 lbf/in²

P₁(abs) = 14.5 + 5.5  psia

P₁(abs) =20 psia

Now by putting the values in the above equation 1

8=\dfrac{P_2_{abs}}{20}

P_2_{abs}=8\times 20\ psia

P_2_{abs}=160\ psia

Therefore the exit gas pressure will be 160 psia (absolute).

7 0
3 years ago
Other questions:
  • A cylindrical bar of steel 10.1 mm (0.3976 in.) in diameter is to be deformed elastically by application of a force along the ba
    15·1 answer
  • Write a method called compFloat5 which accepts as input two doubles as an argument (parameter). Write the appropriate code to te
    9·1 answer
  • List the main activities of exploration??
    5·1 answer
  • During an experiment conducted in a room at 25°C, a laboratory assistant measures that a refrigerator that draws 2 kW of power h
    13·1 answer
  • The equation for the velocity V in a pipe with diameter d and length L, under laminar condition is given by the equation V=Δpdsq
    10·1 answer
  • a digital multimeter is set to read dc volts on the 4 volt scale the meter leads are connected to a 12 volt battery what will th
    14·2 answers
  • Engineers need to be open-ended when dealing with their designs. Why?
    11·1 answer
  • Of the core elements of successful safety and health programs, Management Leadership, Worker Participation, and what else relate
    10·2 answers
  • Explain the prosses of welding
    12·2 answers
  • Nec ________ covers selection of time-delay fuses for motor- overload protection.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!