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 wave-particle duality theory is the first adequate explanation of which one of the following observations about the hydrogen
Bingel [31]

Answer:

None of these is correct.

Explanation:

The wave particle duality has to do with Louis de Broglie's proposition that matter could exist as waves or particles.

According to him, matter poseses an associated wavelength. Hence, a certain wavelength is traceable to the hydrogen atom.

This wavelength is the ratio of Plank's constant to the momentum of the hydrogen atom

3 0
3 years ago
What setting do i dry my jordan max arua 2s on in the dryer <br>will mark brainliest
antiseptic1488 [7]
Probably low heat and a longer time. Better sad than sorry
3 0
3 years ago
1.The moist unit weights and degrees of saturation of a soil are given: moist unit weight (1) = 16.62 kN/m^3, degree of saturati
alexandr1967 [171]

Answer:

Gs = 2.647

e = 0.7986

Explanation:

We know that moist unit weight of soil is given as

\gamma_m \ or\ bulk\ density = \frac{(Gs+Se)\times \gamma_w}{(1+e)}

where,  \gamma_m = moist unit weight of the soil

Gs = specific gravity of the soil

S = degree of saturation

e = void ratio

\gamma_w = unit weight of water = 9.81 kN/m3

From data given we know that:

At 50% saturation,\gamma_m = 16.62 kN/m3

puttng all value to get Gs value;

16.62= \frac{(Gs+0.5*e)\timees 9.81}{(1+e)}

Gs - 1.194*e = 1.694 .........(1)

for saturaion 75%, unit weight = 17.71 KN/m3

17.71 = \frac{(Gs+0.75*e)\times 9.81}{(1+e)}

Gs - 1.055*e = 1.805 .........(2)

solving both  equations (1) and (2), we obtained;

Gs = 2.647

e = 0.7986

6 0
3 years ago
1. A thin-walled cylindrical pressure vessel is capped at the end and is subjected to an internal pressure (p). The inside diame
Vesna [10]
I DONT KNOW OKAY UGHHH
6 0
3 years ago
Who is the inventor that created the light bulb
uranmaximum [27]

Answer:

Thomas Elva Edison

He invented light.

4 0
3 years ago
Other questions:
  • Ammonia gas is diffusing at a constant rate through a layer of stagnant air 1 mm thick. Conditions are such that the gas contain
    14·1 answer
  • 1000 lb boulder B is resting on a 500 lb platform A when truck C accidentally accelerates to the right (truck in reverse). Which
    15·1 answer
  • Determine the maximum volume in gallons​ [gal] of olive oil that can be stored in a closed cylindrical silo with a diameter of 3
    12·1 answer
  • Consider a drainage basin having 60% soil group A and 40% soil group B. Five years ago the land use pattern in the basin was ½ w
    12·1 answer
  • This app, I'm done, bye... I can't, bye
    11·1 answer
  • Parting tool purpose
    13·1 answer
  • Heyyyyyyyyy people wrud
    7·1 answer
  • What were some of the challenges to safety resulting from such radical airframe designs as highly swept wings, high wing loading
    15·1 answer
  • Provide five strategies to stimulate brainstorming. (according to PLTW)
    11·1 answer
  • What is chemical engieering ?​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!