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
Accelerating charges radiate electromagnetic waves. calculate the wavelength of radiation produced by a proton in a cyclotron wi
levacccp [35]

B = magnetic field in the cyclotron = 0.400 T

q = magnitude of charge on a proton = 1.6 x 10⁻¹⁹ C

m = mass of the proton = 1.67 x 10⁻²⁷ kg

f = frequency of revolution of proton in the cyclotron = ?

v = speed of electromagnetic waves = 3 x 10⁸ m/s

λ = wavelength of electromagnetic wave = ?

Frequency of revolution of proton in the cyclotron is given as

f = qB/(2πm)

inserting the values

f = (1.6 x 10⁻¹⁹)(0.400)/(2 (3.14) (1.67 x 10⁻²⁷))

f = 6.1 x 10⁶ Hz

wavelength of electromagnetic wave is given as

λ = v/f

λ = (3 x 10⁸)/(6.1 x 10⁶)

λ = 49.2 m

7 0
3 years ago
Read 2 more answers
Which of the following is not true about arid deserts?
andrezito [222]

Answer:

The answer is actually b

Explanation:

B.

The rain falls mostly as snow during the winter.

3 0
3 years ago
WILL GIVE BRAINLIEST AND 60 POINTS!
natali 33 [55]

Based on the list above the correct properties of solids are; 

B) has a rigid shape that does not change easily

E) has particles that can wiggle but cannot move

Solids have a variety of properties that make them different from liquids and gasses. Their particles are fixed making them rigid and hard to change shape. The particles also have a low kinetic energy making it hard for the particles to vibrate. In addition to those properties, solids cannot be compressed into smaller sizes.

7 0
4 years ago
What would be the average fixed cost per unit at an activity level of 5,200 units? assume that this level of activity is within
Vitek1552 [10]

The average fixed cost per unit at an activity level of 5,200 units is $6.00.

<h3>What is the average fixed cost?</h3>

The average fixed cost (AFC) is fixed cost that does not change with the change in the number of goods and services produced by a company. To put it in a nutshell, average fixed cost (AFC) is the fixed cost per unit and is calculated by dividing the total fixed cost by output level.

Since no cost is fixed for a long time, average fixed cost is only for a short run. When units of production increase, the average fixed cost per unit decreases. Similarly, when the business produces less units, average cost increases per unit.

However, only one unit, mostly capital, is fixed. Examples of average fixed cost are the salaries of permanent employees, mortgage payment on machinery and plant, rent, more.

Average Fixed Cost Formula:

AFC = Total fixed cost/Output (Q)

To know more about plant visit: brainly.com/question/22167412

#SPJ4

4 0
2 years ago
HELP ME ASAP!!!!! A patient in the hospital is undergoing testing. The patient's brain is sending electrical signals to motor ne
AysviL [449]

Answer:

The patient could be going through paralysis, which is when the motor neurons are severed which stops electrical signals from passing into the muscles.  It can be caused by severe trauma to the body or psychological stress.

(I'm not sure if this is the best answer so you might want to double-check online)

3 0
3 years ago
Other questions:
  • A layer of oil (n = 1.38) floats on an unknown liquid. A ray of light originates in the oil and passes into the unknown liquid.
    15·1 answer
  • An overnight rainstorm has caused a major roadblock. Three massive rocks of mass m1=584 kg, m2=838 kg, and m3=322 kg have blocke
    9·1 answer
  • A horizontal force of magnitude 46.7 N pushes a block of mass 4.35 kg across a floor where the coefficient of kinetic friction i
    12·1 answer
  • A sports car engine delivers 150 kW to the driveshaft with a thermal efficiency of 20%. The fuel has a heating value of 35 000 k
    15·1 answer
  • As a object falls from a high-flying stationary helicopter, its velocity increases and its acceleration ____.
    9·2 answers
  • What is Hooke's law? what is meant by elastic limit?<br>please answer me​
    9·1 answer
  • A projectile is fired at a speed of 125 m/s toward a tall building. The building is a horizontal distance of 75 meters from the
    14·1 answer
  • What is the mass of a substance that has a density of 5g/ml and the volume of 3ml
    12·1 answer
  • A number line goes from negative 5 to positive 5. Point D is at negative 4 and point E is at positive 5. A line is drawn from po
    5·2 answers
  • Which rational number could be graphed between 0 and 1?A number line going from negative 5 to positive 3 in increments of 1.Nega
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!