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
A truck loaded with sand accelerates along a highway. The driving force on the truck remains constant. What happens to the accel
pickupchik [31]

Answer:

Acceleration will increase.

Explanation:

The relation between force, mass and acceleration according to the Newton's second law of motion is given as:

F = ma

We are given that the driving force on the truck remains constant, so F is constant here. We can rewrite the above equation as:

a=\frac{F}{m}

Since, F is constant, the acceleration of the truck is inversely proportional to the mass.

There is a hole at the bottom of the truck through which the sand is being lost at a constant rate. Since, the sand is being lost, the overall mass of the truck is being reduced.

Since, the acceleration of the truck is inversely proportional to the mass, the reduced mass will result in an increased acceleration.

So, the acceleration of the truck will increase.

4 0
3 years ago
A car speeds up from 13 m/s to 23 m/s in 30 seconds. What is the
Lapatulllka [165]

acceleration of the car = 0.33 m/s²

Explanation:

To calculate the acceleration of the car we use the following formula:

acceleration = change in velocity / time

change in velocity = final velocity - initial velocity

change in velocity = 23 m/s - 13 m/s = 10 m/s

change in velocity = 10 m/s

acceleration = 10 m/s / 30 s

acceleration = 0.33 m/s²

Learn more about:

acceleration

brainly.com/question/4134594

brainly.com/question/1213762

#learnwithBrainly

8 0
3 years ago
How much distance does it take to stop a car going 30 m/s (67 mph) if the brakes can apply a force equal to one half the car’s w
denpristay [2]

Answer:

0

rqc3fgt9uwgtd.ojbxrfdgi8ubvg iohy

5 0
2 years ago
Question 5 (1 point)
Tom [10]

Answer: 18000 coulombs

Explanation:

Given that:

Current, I = 5.0A

Electric charge Q = ?

Time, T = 1 hour

(The SI unit of time is seconds. So, covert 1.0 hour to seconds)

If 1 hour = 60 minutes and 60 seconds = 1 minute

Then, 1.0 hour = (60 x 60)

= 3600 seconds

Since electric charge, Q = current x time

i.e Q = I x T

Q = 5.0 A x 3600 seconds

Q = 18000 coulombs

Thus, 18000 coulombs of charge flows through the lamp in this time.

4 0
3 years ago
Which measurement can she expect once the water begins to boil??
tresset_1 [31]

Answer:

200

Explanation:

has to be long this us just random words anseer is b. 100

5 0
3 years ago
Other questions:
  • The connections of many simple pieces in the brain is evidence of the:
    11·2 answers
  • In an experiment what are all the parts of an experiment that remain unchanged are called<br>​
    5·1 answer
  • What is the formula to used to find work?
    9·1 answer
  • An amoeba is a one-celled protist. Amoeba contain all the organelles of a typical eukaryotic animal cell. It is a heterotroph an
    10·1 answer
  • A ball of mass 24.1 g is attached to a cord of length 0.417 m and rotates in a vertical circle. What is the minimum speed the ba
    7·1 answer
  • How can you break open a coconut without ANY tools, only your hands, that means no rocks, no hammers, no special tools, and don'
    13·1 answer
  • A storage tank contains a liquid at depth y where y=0 when the tank is half full. liquid is withdrawn at a constant flow rate q
    10·1 answer
  • Se lanza una pelota de béisbol desde la azotea de un edificio de 25 m de altura con velocidad inicial de magnitud 10 m/s y dirig
    12·1 answer
  • Considering how the parts of a system work together and affect one another, other systems, and the environment is called _______
    6·1 answer
  • Magnesium hydroxide is a common ___?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!