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
Dennis_Churaev [7]
3 years ago
11

Write a program which asks the user to enter N numbers. The program will print out their average. Try your program with the foll

owing numbers: 20.5, 19.7, 21.3, 18.6 and 22.1
Computers and Technology
1 answer:
Likurg_2 [28]3 years ago
7 0

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

int n;

double average,sum=0,x;

cout<<"enter the Value of N:";

// read the value of N

cin>>n;

cout<<"enter "<<n<<" Numbers:";

// read n Numbers

for(int a=0;a<n;a++)

{

   cin>>x;

   // calculate total sum of all numbers

   sum=sum+x;

}

// calculate average

average=sum/n;

// print average

cout<<"average of "<<n<<" Numbers is: "<<average<<endl;

return 0;

}

Explanation:

Read the total number from user i.e "n".Then read "n" numbers from user with for loop and sum them all.Find there average by dividing the sum with n.And print the average.

Output:

enter the Value of N:5

enter 5 Numbers:20.5 19.7 21.3 18.6 22.1

average of 5 Numbers is: 20.44

You might be interested in
Use the five-step decision-making process discussed in Chapter 1 to analyze the following situations and recommend a course of a
RideAnS [48]

Answer:

The responses to this question can be defined as follows:

Explanation:

Yeah, their numerous sponsorships brands have potential. Every business does have its Trademarks for a commodity, that distinguishes others. It's an infringement for trademarks, it has only provided to those trivialities, which success and if I would plan this for my friend. I would never list or show those points of his accomplishments I never would Numerous sponsors. This should include all its information using its trademarks as well as other Site partners are excluded even though they are or are browsing their trademarks where the law is prohibited.

7 0
3 years ago
Question very important cause after my school is over at 5 'oclock I will be playing rocket league if anyone wants to play just
jarptica [38.1K]

Answer:

So can u tell me wut is ur question...It is not understandable

6 0
2 years ago
What is the output of the following program?
Angelina_Jolie [31]

Answer:

the output of that code would be invalid syntax since the line,

>>> numA = numA * 5

is not indented.

The output of

>>> numA = 2

>>> while numA < 30:

>>> numA = numA * 5

>>> print(numA)

would be 50.

3 0
3 years ago
Read 2 more answers
If you want to clear an operating system's temporary files for storage, performance, or privacy reasons, you should run a disk _
VashaNatasha [74]

Answer:

Cleanup is correct:)

Explanation:

8 0
2 years ago
After earning a learner’s license, what test must be successfully passed to earn an operator’s license?
ZanzabumX [31]
<span>The correct answer is Driving Skills Test.  After earning a learner’s license, Driving Skills test must be successfully passed to earn an operator’s license.  </span>50 hours of driving has to be documented and 10 hours driving at night time.
7 0
3 years ago
Other questions:
  • WILL GIVE BRAINLIEST PLEASE HELP / urgent
    9·1 answer
  • Which of the following is a domestic business activity?
    6·2 answers
  • A user on a home network needs to boost the signal of the wireless router. What should the user purchase to accomplish this?
    14·1 answer
  • The following function takes an array of n integers as its input and returns 1 if the array is sorted in non-decreasing order, 0
    15·1 answer
  • Where in an email would u find information about the action requirements​
    9·1 answer
  • Given the char * variables name1, name2, and name3, write a fragment of code that assigns the largest value to the variable max
    15·1 answer
  • The first idea for a communications network was called
    14·2 answers
  • The Department Manager researches new data platforms for the company and requests a list of essential features. Which essential
    6·1 answer
  • A set of blocks contains blocks of heights 1,2, and 4 centimeters. Imagine constructing towers of piling blocks of different hei
    15·1 answer
  • One of the First-Generation Computer built in 1942 during the Second World War and fully utilized to compute Military Artillery
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!