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
Keith_Richards [23]
3 years ago
9

Write a program that calculates the average of n integers. the program should prompt the user to enter the value for n and then

afterward must enter all n numbers. if the user enters a nonpositive value for n, then an exception should be thrown (and caught) with the message "n must be positive." if there is any exception as the user is entering the n numbers, an error message should be displayed, and the user prompted to enter the number again.
Physics
1 answer:
ikadub [295]3 years ago
8 0

#include<studio.h>

int main( )

{

int n;

int a,b,c,d,x,y;

int avarage;

printf("enter value of n:\n");

scanf("%d",&n);

printf("enter value of a:\n,b:\n,c:\n,d:\n,x:\n,y:\n);

scan f("%d\%d\n%d\n%d\n%d\n%d\n",&a,b,c,d,x,y);

sum=(a+b+c+d+x+y);

avarage=(sum/n);

print f("%d",avarage);

if

{

n=positive interger

}

else

{

printf ("n must be positive");

}

return 0;

}

You might be interested in
Calculate the amount of heat (kcal) released when 50.0g of steam at 100*c hits the skin, condenses, and cools to a body temperat
luda_lava [24]
As the steam touches the skin, it undergoes a phase change and releases latent heat due to the phase change. As it reaches equilibrium, it releases sensible heat. We calculate as follows:

Q = latent heat + sensible Heat
Q = 2.26 kJ / g (50.0 g) + 50.0 g ( 4.18 J / g C) (37 C - 100 C) ( 1 kJ / 1000 J)
Q = 99.833 kJ
6 0
3 years ago
Read 2 more answers
A large body collides with a stationary small body from the rear end. How do the bodies behave if the collision is inelastic?.
alexdok [17]
If the collision is inelastic, there is every possibility that the large body will drag the small stationary body along with it in the direction of the collision. Some amount of heat, light and sound energy will also be produced due to the kinetic energy of the large body. I hope the answer helps you.
6 0
3 years ago
Which measurements are equal to 321 decimeters? Check all that apply.
S_A_V [24]
32,100 Millimeters
3,210 Centimeters
3.21 Decameters

Hope It Helps
5 0
3 years ago
Read 2 more answers
An object is dropped on Earth from a height of 15 m. What is the magnitude of the velocity of the object just as it hits the gro
ivolga24 [154]
Here, we know, according to 3rd Equation of Kinematics, 
v² - u² = 2as

Here, u = 0  [ Free fall ]
a = 9.8 m/s² [ constant value for the Earth system ]
s = 15 m

Substitute their values, 
v² - 0² = 2 * 9.8 * 15
v² = 294
v = √294
v = 17.15 m/s

In short, Your Answer would be Option D

Hope this helps!
8 0
3 years ago
Read 2 more answers
In treatment the so called "nervous " disorder, freuad discovered the most effetive method to be
maks197457 [2]

Answer:

Freud believed that people could be cured by making conscious their unconscious thoughts and motivations, thus gaining insight. The aim of psychoanalysis therapy is to release repressed emotions and experiences, i.e., make the unconscious conscious.

Hope this helps. If it does, please mark me brainliest.

Explanation:

6 0
3 years ago
Other questions:
  • There is an increasing demand for berries in Paul’s town. He wants to cultivate berries to earn profits. To do so, he wants to c
    12·1 answer
  • There are eight men sitting on a couch. Three legs break and six men leave. How many legs are remaining
    15·2 answers
  • Pancake syrup taken out of the refrigerator will be difficult to pour because low temperature increases viscosity.
    6·2 answers
  • The velocity of sound on a particular day outside is 331 meters/second. What is the frequency of a tone if it has a wavelength o
    6·2 answers
  • How can you tell the stigma from the stamens in the flowers​
    5·1 answer
  • Which phenomenon occurs when a wave encounters a non–transmitting barrier
    12·2 answers
  • A particle is projected with velocity v0 directly up a slope which makes an angle α with the horizontal. Assume frictionless mot
    15·1 answer
  • A basketball has a volume of 300 cm3. If Michael pumped 200 cm3 and Fandi pumped another 200 cm3 into it then the total volume o
    5·1 answer
  • How can a systematic error affect the reported data?
    13·2 answers
  • A 1,103 kg car traveling at 18 m/s to the south collides with a 4,919 kg truck that is initially at rest at a stoplight. The car
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!