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
Read the information and study the image.
erastova [34]

Answer:

It is impossible to detect underground water from the surface. Dowsing practitioners refuse to explain their secrets.

Explanation:

4 0
3 years ago
A wire of Nichrome (a nickel– chromium– iron alloy commonly used in heating elements) is 1.0 m long and 1.0 mm² in cross-se
Lyrx [107]

Answer:

The conductivity of Nichrome is 2\times 10^6\ S/m.

Explanation:

Given:

Potential difference (V) = 2.0 V

Current flowing (I) = 4.0 A

Length of wire (L) = 1.0 m

Area of cross section of wire (A) = 1.0 mm² = 1 × 10⁻⁶ m² [1 mm² = 10⁻⁶ m²]

We know, from Ohm's law, that the ratio of voltage and current is always a constant and equal to the resistance of the resistor. Therefore, the resistance of the nichrome wire is given as:

R=\frac{V}{A}=\frac{2.0}{4.0}=0.5\ \Omega

Now, resistance of the nichrome wire in terms of its resistivity, length and area of cross section is given as:

R=\rho\frac{L}{A}

Where, \rho\to resistivity\ of\ Nichrome

Now, plug in all the values given and solve for \rho. This gives,

0.5\ \Omega=\rho\frac{1.0\ m}{1\times 10^{-6}\ m^2}\\\\\rho=\frac{0.5\times 1\times 10^{-6}}{1.0}=0.5\times 10^{-6}\ \Omega-m

Now, conductivity of a material is the reciprocal of its resistivity. Therefore, the conductivity of Nichrome is given as:

\sigma=\frac{1}{\rho}=\frac{1}{0.5\times 10^{-6}}=2\times 10^6\ S/m

Conductivity is measured in Siemens per meter (S/m)

Therefore, the conductivity of Nichrome is 2\times 10^6\ S/m.

7 0
2 years ago
12.7 cm =_____________mm<br> ​
BlackZzzverrR [31]
Answer : 12.7 cm = 127. mm
4 0
3 years ago
Until 1883, every city and town in the United States kept its own local time. Today, travelers reset their watches only when the
inna [77]

Answer:

135° (degrees)

Explanation:

The Earth rotates 360° in about 24 h

How many degrees in 1 hour

360^{\circ}=24\ h\\\Rightarrow 1\ h=\frac{360}{24}\\\Rightarrow 1\ h=15^{\circ}

So, in 1 hour the Earth rotates 15 degrees. This means that a person would have to reset their watch by 1 hour after travelling 15 degrees

In 9 hours

9\ h=9\times 15^{\circ}=135^{\circ}\\\Rightarrow 9\ h=135^{\circ}

So, a person would have to travel 135 degrees in order to reset their watch by 9 hours.

7 0
3 years ago
How do you determine the standard error on the slope in a simple harmonic motion graph​
elena-14-01-66 [18.8K]

Answer:

by standing on the top of cliff

5 0
2 years ago
Other questions:
  • A wave has a wavelength of 10mm and a frequency of 5 hz what is the speed?
    10·2 answers
  • Name six kinds of simple machines.
    10·2 answers
  • Which of the following is NOT a benefit of cool down activities?
    14·1 answer
  • What will the surface charge density be if the radius of the disk is doubled but its total charge remains the same
    9·1 answer
  • The Earth belongs to the group of rocky planets that orbits between the sun and the asteroid belt. Place these planets in order,
    15·2 answers
  • Do you think energy can be “used up?” Why or why not?
    13·1 answer
  • You do 120 j of work while pulling your sister back on a swing, whose chain is 5.10 m long. you start with the swing hanging ver
    15·1 answer
  • A red horse and a black horse raced on a 1-mile long circular racetrack. The red horse
    7·2 answers
  • Galois drove 60.0 kilometers due west in 5.00 hours and then drove 43.0 kilometers due north in 3.00 hours.
    6·1 answer
  • find the density, in g/cm3g/cm3 , of a metal cube with a mass of 50.3 gg and an edge length (l)(l) of 2.65 cmcm . for a cube v
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!