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 the lowest possible temperature
HACTEHA [7]
The lowest possible temperature is absolute zero. However scientists have not reached this temperature, rather they have come very close to absolute zero.

6 0
3 years ago
Read 2 more answers
Index fossils are used to determine the relative ages of rock and fossils and are also used to
kolbaska11 [484]

Index fossils are used to determine the relative ages of rock and fossils and are also used to define the boundaries between geologic periods.

<u>Option: A</u>

<u>Explanation:</u>

The fossils which are recognized as fossils guides or indicator fossils are used to classify and recognize geological or faunal periods, termed as index fossils. It must be of short vertical reach, wide geographic distribution and swift patterns in evolution. It helps to assess the rock layers ' age and helps to date other fossils found close and around them. For an instance, Ammonites were abundant in the Mesozoic period between 245 to 65 mya, they have not been found after the Cretaceous era, as they became endangered during the K-T extinction (65 mya).

3 0
3 years ago
A hot air balloon is traveling vertically upward at a constant speed of 4.5 m/s. When it is 28 m above the ground, a package is
ella [17]

Answer:

1.97 seconds

Explanation:

t = Time taken

u = Initial velocity

v = Final velocity

s = Displacement

a = Acceleration due to gravity = 9.8 m/s²

s=ut+\frac{1}{2}at^2\\\Rightarrow 21=4.5t+\frac{1}{2}\times -9.8\times t^2\\\Rightarrow 21=-4.5t-4.9t^2\\\Rightarrow 4.9t^2+4.5t-28=0\\\Rightarrow 49t^2+45t-280=0

Solving the above equation we get

t=\frac{-45+\sqrt{45^2-4\cdot \:49\left(-280\right)}}{2\cdot \:49}, \frac{-45-\sqrt{45^2-4\cdot \:49\left(-280\right)}}{2\cdot \:49}\\\Rightarrow t=1.97, -2.89

So, the time the package was in the air is 1.97 seconds

3 0
3 years ago
a small table has a mass of 4kg, stands on four legs, each leg having an area of 0.001 m2. what is the pressure exerted by the t
Gemiola [76]

Answer:

P = 10 kPa

Explanation:

Given that,

The mass of a small table, m = 4 kg

The area of each leg = 0.001 m²

We need to find the pressure exerted by the table on the floor. Pressure is equal to the force per unit area. So

P=\dfrac{mg}{4\times A}\\\\P=\dfrac{4\times 10}{4\times 0.001}\\P=10000\ Pa\\\\or\\\\P=10\ kPa

So, the required pressure is 10 kPa.

3 0
2 years ago
Examine the spectra of the four unknown substances shown below. What can you conclude?
oksian1 [2.3K]
Line spectra are obtained when individual elements are heated using a high-voltage electrical discharge. This heating causes excitation of the element and a subsequent emission of distinct lines of colored light are obtained. Each element has its own unique emission line spectrum; therefore, if any of the tested substances were the same, their spectra would match. However, this is not the case so none of the substances are the same.
 hope it helps!
7 0
3 years ago
Read 2 more answers
Other questions:
  • How many neutrons does element X have if it’s atomic number is 28 and it’s mass number is 81?
    8·2 answers
  • A water skier lets go of the tow rope upon leaving the end ofa
    13·1 answer
  • My questions are in the picture: <br>Please help.
    7·1 answer
  • A 0.50-$kg$ block slides along a small track with elevated ends and a flat central part. The flat part has a length L = 1.00 $m$
    7·1 answer
  • Ravens eat meat but they don’t kill it themselves. What kind of animal does this make them?
    13·1 answer
  • Manganese-52 has a half-life of 6 days. How many days would a scientist have to wait for the radioactivity to be 12.5% the start
    10·2 answers
  • If a 8860 N horse has been lifted 4.5 meters by a crane, what work does it have?
    13·1 answer
  • Materials that allow electricity to pass through them are called ?
    8·1 answer
  • Two wooden crates rest on top of one another. The smaller top crate has a mass of m1 = 25 kg and the larger bottom crate has a m
    14·1 answer
  • Problem 2: (15 pts) A 10-m high cylindrical container is half-filled at the bottom with water of density =1000 kg/m3 while the t
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!