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
The yield stress of a steel is 250Mpa. A steel rod used for implant in a femurneeds to withstand 29KN. What should the diameter
OleMash [197]

Answer:

r = 1.922 mm

Explanation:

We are given;

Yield stress; σ = 250 MPa = 250 N/mm²

Force; F = 29 KN = 29000 N

Now, formula for yield stress is;

σ = F/A

A = F/σ

Where A is area = πr²

Thus;

r² = 2900/250π

r² = 3.6924

r = √3.6924

r = 1.922 mm

3 0
3 years ago
For three control stations,there should be how many start buttons in parallel with the suxiliary contact
valentinak56 [21]
The three load contacts connected between the three-phase power line and the motor close to connect the motor to the line. The normally open auxiliary contact connected in parallel with the two Start buttons closes to maintain the circuit to M coil when the Start button is released.
6 0
3 years ago
How are engine bearings lubricated?
Musya8 [376]

Answer:

Engine bearings are lubricated by <u>motor oils</u> constantly supplied in sufficient amounts to the bearings surfaces. Lubricated friction is characterized by the presence of a thin film of the pressurized lubricant

Explanation:

7 0
3 years ago
Read 2 more answers
the ____ grinder provides more precise x- and y-axis movements than a vertical milling machine for extremely accurate positionin
Alexxx [7]

Answer:

the jig grinder provides more precise x- and y-axis movements than a vertical milling machine for extremely accurate positioning

3 0
1 year ago
1
Nezavi [6.7K]

Answer:

C increase

Explanation:

V=R*C;

C= V/R, so if you replace the resistor the C increase

5 0
2 years ago
Other questions:
  • A vacuum pump is used to drain a basement of 20 °C water (with a density of 998 kg/m3 ). The vapor pressure of water at this tem
    13·1 answer
  • If a hoist lifts a 4500lb load 30ft in 15s, the power delivered to the load is a) 18.00hp b) 9000hp c) 16.36hp d) None of the ab
    8·1 answer
  • A 625 g basketball and a 58.5 g tennis ball are dropped from a height of d = 1.5 m onto the floor. The coefficient of restitutio
    10·1 answer
  • Water at 20 °C is flowing with velocity of 0.5 m/s between two parallel flat plates placed 1 cm apart. Determine the distances f
    5·1 answer
  • The solid cylinders AB and BC are bonded together at B and are attached to fixed supports at A and C. The modulus of rigidity is
    6·1 answer
  • A gas pressure difference is applied to the legs of a U-tube manometer filled with a liquid with specific gravity of 1.7. The ma
    15·2 answers
  • Wastewater flows into a once it is released into A floor drain
    11·1 answer
  • On the generalized enthalpy departure chart, the normalized enthalpy departure values seem to approach zero as the reduced press
    12·1 answer
  • Calculate the number of vacancies per cubic meter at 1000∘C for a metal that has an energy for vacancy formation of 1.22 eV/atom
    14·1 answer
  • Name some technical skills that are suitable for school leavers .​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!