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]
2 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]2 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
Lucas left a metal bowl and a wooden bowl outside overnight. The next morning, he picked up the bowls to bring them inside. He n
kipiarov [429]

Answer: C. Metal transfers heat away from the skin by conduction, creating the sensation of coolness.

Explanation: The skin releases heat into the metal bowl since there is a difference in temperature between the two objects. So heat is taken away from the hand abd transfers into the metal bowl by conduction creating a cooler sensation.

8 0
3 years ago
Zoe is shown two mystery boxes that are both 8,000cm3. Her teacher tells her that one mystery box is filled with rocks and the o
krek1111 [17]

Answer:

The box of rocks will have depression which can be seen without touching the box.

Explanation:

The density of rocks is very large as compared with napkins. So, the weight of the rocks will be much more greater than that of napkins.

As both boxes have same volume the heavier box will show depression on the lower surface as compared to the lighter box. So, the box of rocks will have depression which can be seen without touching the box.

5 0
2 years ago
In an HVAC system, the purpose of pneumatics is to serve as A. a controller B. conditional air flow C. an energy source D. a sou
Naya [18.7K]

Answer: <u><em>A</em></u>

Explanation:

A pneumatic control system uses compressed air as a method of control for HVAC systems. ... Each senor responds to changes in temperature, humidity, and static pressure as examples, to provide feedback in a control loop to open or close the actuator to meet the control set point.

3 0
3 years ago
Why do mirrors form inverted images?
marysya [2.9K]

Answer:

Explanation:

The image is real light rays actually focus at the image location). As the object moves towards the mirror the image location moves further away from the mirror and the image size grows (but the image is still inverted).

3 0
2 years ago
Read 2 more answers
Which of the statements given below is correct? 1. In winter, the wind blows from land to oceans. 2. In summer , the winds blow
densk [106]

Answer:

The second one should be correct

3 0
2 years ago
Other questions:
  • What are 3 major areas of society affected by science
    5·1 answer
  • The bending of light as it passes into a transparent material of different optical intensity is known as
    11·2 answers
  • 5.00 kg of liquid water is heated to 100.0 °C in a closed system. At this temperature, the density of liquid water is 958 kg/m3.
    11·1 answer
  • What is the difference between an energy pyramid and a biomass pyramid?
    8·1 answer
  • Why do you think nutrition experts recommend that young people<br> eat foods high in calcium?
    9·1 answer
  • Which of these experiments would make use of qualitative data?
    7·1 answer
  • What happens to light when it is shone through concave lenses? (1 point)
    13·2 answers
  • Please help me......
    8·1 answer
  • Samaira needs to rent some tents for an outdoor family reunion in July what is the best type of tent for Samaira to rent so that
    7·2 answers
  • A light has wavelength of is used in the double slits experiment . Which of the following values represent the phase difference
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!