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
What is heat energy on earth escapes into space
Firdavs [7]

Answer:

Latent heat, along with birds, ride those rising columns of air. This brings up a third and the ultimate mechanism by which the Earth's heat escapes into space, which is electromagnetic radiation. Every object, including the Earth's surface, absorbs and radiates heat electromagnetically

Explanation:

I LITERALLY JUST COPIED AND PASTED THIS FROM GOOGLE..i dont understand anything from it since im not on this topic but hope this help a little....i got it from google ..not my own work

5 0
3 years ago
What r photons? <br> ........................,........,..........
AVprozaik [17]

Answer:

in physics, a photon is a bundle of electromagnetic energy. It is the basic unit that makes up all light

Explanation:

6 0
3 years ago
Read 2 more answers
PLEASE HELP ME
Snowcat [4.5K]

Answer:

Compound.

Explanation:

6 0
3 years ago
Read 2 more answers
How do longshore currents shape the land?
Sonbull [250]
Longshore drift has a very powerful influence on the shape and composition of the coastline. It changes the slopes of beaches and creates long, narrow shoals of land called spits, that extend out from shore. Longshore drift may also create or destroy entire “barrier islands” along a shoreline.
5 0
2 years ago
Read 2 more answers
A car has a mass of 1600 kg. It is stuck in the snow and is being pulled out by a cable that applies a force of 7560 N due north
sergiy2304 [10]

Answer:

Acceleration of the car will be a=0.1375m/sec^2

Explanation:

We have given mass of the ball m = 1600 kg

Force in north direction F= 7560 N

Resistance force which opposes the movement of car F_R=7340N

So net force on the car F_{net}=F-F_R=7560-7340=220N

According to second law of motion we know that F=ma

So 220=1600\times a

a=0.1375m/sec^2

7 0
3 years ago
Other questions:
  • How long do congressional terms last
    15·1 answer
  • A rock weighing 20 n (mass = 2 kg) is swung in a horizontal circle of radius 2 m at a constant speed of 6 m/s. what is the centr
    13·2 answers
  • Preparing an Accounts Payable Schedule Pilsner Inc. purchases raw materials on account for use in production. The direct materia
    7·2 answers
  • Can I have some help please? It would mean a lot!
    14·1 answer
  • What is meant by the period of a pendulum?
    14·1 answer
  • 112. A string, fixed on both ends, is 5.00 m long and has a mass of 0.15 kg. The tension if the string is 90 N. The string is vi
    13·1 answer
  • The speed of the cart after 8 seconds of Low fan speed is
    13·1 answer
  • A 10 kg computer accelerates at a rate of 5 m/s2. How much force was applied to the computer?​
    13·2 answers
  • Does a heavier object or a lighter object experience a greater gravitational<br> force?
    11·1 answer
  • 7. A volcanic island arc is formed when
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!