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 butcher grinds 5 and 3/4 lb of meat then sells it for 2 and 2/3 pounds to the customer what is the maximum amount me that the
KiRa [710]

Answer:

The maximum amount of meat that the butcher can sell is  3\frac{1}{12}\:lb

Explanation:

The maximum amount can be found by taking the difference of mixed numbers.

5\frac{3}{4}-2\frac{2}{3}\\\\\mathrm{Subtract\:the\:numbers:}\:5-2=3\\\\\mathrm{Combine\:fractions:\:}\frac{3}{4}-\frac{2}{3}=\frac{1}{12}\\\\=3\frac{1}{12}\\

Best Regards!

8 0
3 years ago
A singly charged positive ion has a mass of 3.46 × 10−26 kg. After being accelerated through a potential difference of 215 V the
jasenka [17]

Answer:

1.8 cm

Explanation:

m = mass of the singly charged positive ion = 3.46 x 10⁻²⁶ kg

q = charge on the singly charged positive ion = 1.6 x 10⁻¹⁹ C

\Delta V =Potential difference through which the ion is accelerated = 215 V

v = Speed of the ion

Using conservation of energy

Kinetic energy gained by ion = Electric potential energy lost

(0.5) m v^{2} = q \Delta V\\(0.5) (3.46\times10^{-26}) v^{2} = (1.6\times10^{-19}) (215)\\(1.73\times10^{-26}) v^{2} = 344\times10^{-19}\\v = 4.5\times10^{4} ms^{-1}

r = Radius of the path followed by ion

B = Magnitude of magnetic field = 0.522 T

the magnetic force on the ion provides the necessary centripetal force, hence

qvB = \frac{mv^{2} }{r} \\qB = \frac{mv}{r}\\r =\frac{mv}{qB}\\r =\frac{(3.46\times10^{-26})(4.5\times10^{4})}{(1.6\times10^{-19})(0.522)}\\r = 0.018 m \\r = 1.8 cm

5 0
3 years ago
Who made advances to our understanding of the conscious and unconscious mind?
NARA [144]
The unconscious mind plays a large role in Sigmund Freud's psychoanalysis<span>. He discussed the importance of the unconscious mind in understanding conscious thought and behaviour.   </span><span>Sigmund Freud

</span>
4 0
3 years ago
Read 2 more answers
Charles Darwin,
grandymaker [24]
The answer is B artificial selection
3 0
3 years ago
Read 2 more answers
A piece of styrofoam has a charge of 0.002 mC and is placed 0.5 m from a grain of salt with a charge of 0.03 nC. How much electr
aleksklad [387]

Answer:

2.16×10⁻⁶ N

Explanation:

Applying,

F = kqq'/r² (coulomb's Law)....................... Equation 1

Where F = electrostatic force, k = coulomb's constant, q = charge on the styrofoam, q' = charge on the grain of salt, r = distance between the charges.

From the question,

Given: q = 0.002 mC = 2.0×10⁻⁶ C, q' = 0.03 nC = 3.0×10⁻¹¹ C, r = 0.5 m

Constant: k = 8.99×10⁹ Nm²/C²

Substitute these values into equation 1

F = (2.0×10⁻⁶)(3.0×10⁻¹¹)(8.99×10⁹)/0.5²

F = 2.16×10⁻⁶ N

5 0
2 years ago
Other questions:
  • a motorcycle accelerates from 15 m/s to 20 m/s over a distance of 50 meters. what is its average acceleration?
    10·1 answer
  • Is the stomach just below the waist?
    14·1 answer
  • Rutherford hypothesized that, in his experiment,more alpha particles would be deflected if ?
    13·1 answer
  • On average, each person in the industrialized world is responsible for the emission of 10,000 kg of carbon dioxide () every year
    7·1 answer
  • A ball thrown horizontally from an apartment balcony hits the ground in 5 seconds. If the horizontal velocity of the ball is dou
    11·1 answer
  • A holiday ornament in the shape of a hollow sphere with mass 0.015 kg and radius 0.055 m is hung from a tree limb by a small loo
    7·1 answer
  • What kind of small object composes much of the universe?
    14·1 answer
  • ¿ Sobre que superficie se desplazara mas rápidamente un tejo, sobre cemento o sobre cerámica? ¿por que?
    11·1 answer
  • Energy is the energy an object has because it is in motion. *
    9·1 answer
  • It's a frightening idea, but what would be the sound intensity level of 100 physics professors talking simultaneously
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!