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
An electron with a charge of -1.6 × 10-19 coulombs experiences a field of 1.4 × 105 newtons/coulomb. What is the magnitude of th
RSB [31]
F=Eq. Just sub in the values and you are done.
7 0
3 years ago
Read 2 more answers
When is liquid is heated from 20 degree to 60 degree centigrade its density​
Anna35 [415]

Answer:

°C = Density of water (g/cm3)

4° = 1.0000

20° = 0.9982

40° = 0.9922

60° = 0.9832

80° = 0.9718

8 0
3 years ago
Which of the following is a common physical property of ionic compounds? A. high melting point B. insoluble in water C. conduct
bezimeni [28]
B. insoluble in water
4 0
3 years ago
Read 2 more answers
Which of the following is a TRUE statement about the differences between electromagnetic and mechanical waves?
Butoxors [25]

' D ' is the only correct statement on the list.


Electromagnetic waves are capable of traveling through

many substances, and they're also capable of traveling

through vacuum. Mechanical waves can't travel in vacuum.

8 0
3 years ago
Read 2 more answers
In a football game, a 90 kg receiver leaps straight up in the air to catch the 0.42 kg ball the quarterback threw to him at a vi
irinina [24]

To solve this problem it is necessary to apply the equations related to the conservation of momentum. Mathematically this can be expressed as

m_1v_1+m_2v_2 = (m_1+m_2)v_f

Where,

m_{1,2}= Mass of each object

v_{1,2} = Initial velocity of each object

v_f= Final Velocity

Since the receiver's body is static for the initial velocity we have that the equation would become

m_2v_2 = (m_1+m_2)v_f

(0.42)(21) = (90+0.42)v_f

v_f = 0.0975m/s

Therefore the velocity right after catching the ball is 0.0975m/s

8 0
3 years ago
Other questions:
  • Suppose that air resistance cannot be ignored. For the position at which the person has jumped from the platform and the cord re
    8·1 answer
  • Two football players are pushing a 60kg blocking sled across the field at a constant speed of 2.0 m/s. The coefficient of kineti
    9·1 answer
  • Which of the following is a true statement about objects in a vacuum?
    10·2 answers
  • Which involves reflection of light waves? A. A full moon shows sunlight bouncing off the moon's surface and traveling toward Ear
    8·2 answers
  • A rifle is fired in a valley with parallel vertical walls. The echo from one wall is heard 1.55 s after the rifle was fired. The
    7·1 answer
  • How long is a pendulum with a period of 1.0 S on the moon which has 1/6 of the earths gravity
    14·1 answer
  • Is what happening in the air or the atmosphere at one time in one place
    10·1 answer
  • The velocity of a particle is given by v=20t² - 100t + 50, where v is in meters per second and t is in seconds. Evaluate the vel
    13·2 answers
  • Why do you sometimes get shocked by static electricity? Explain how it happens and give an example.
    15·1 answer
  • How can we show magnetic field lines?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!