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
Software applications called _____ provide the means to record information that passes through a computer or router that is hand
Bezzdna [24]

Answer:

sniffer programs

Explanation:

Software applications called <u>sniffer programs</u>  provide the means to record information that passes through a computer or router that is handling Internet traffic.

3 0
3 years ago
Choose the words that make the following sentence true.<br> Primary memory is
ki77a [65]

Answer:

Primary memory is computer memory that is accessed directly by the CPU

Explanation:

8 0
3 years ago
I need help ASAP Please! :)
amid [387]
Your parents,your school,google,your social media accounts
3 0
3 years ago
GoInternet, Inc., is an Internet-access service provider that is being forced to manage numerous unwanted e-mail messages from a
marissa [1.9K]

Answer:

The correct answer to the following question is option b.)sends messages involving products of companies previously sued under the CAN-SPAM Act.

Explanation:

This act is an act of Controlling the Assault of Non-Solicited Marketing And Other things.

It is the law that establish the rules for the commercial message and the commercial e-mails, gives recipients right to have the business stops emailing them, and they outline the penalties incurred for those person who has violated the law.

8 0
3 years ago
(09 MC)How can understanding your own personality improve your relationships with others?
Mars2501 [29]
B.) is what most employers are looking for
5 0
2 years ago
Other questions:
  • This technology was developed in the 1980s and was a successful attempt to provide services for voice, video, and video traffic
    11·1 answer
  • Why can't you test a program for run-time errors when it has compile-time (syntax) errors
    6·1 answer
  • A four year old laptop will not boot and presents error messages on the screen
    8·1 answer
  • Under what circumstances are composite primary keys appropriate?
    5·1 answer
  • Pascal's Triangle is a triangular array in which every number represents the
    15·1 answer
  • If you add the parameter, ____, the text in the applet window fades in and out as it scrolls.
    7·1 answer
  • If you create and invoke a recursive function without accounting for a base case, what can go wrong?
    15·1 answer
  • Write a statement that increases the value of the int variable total by the value of the int variable amount. that is, add the v
    5·1 answer
  • A bluetooth network consists of _____ primary device(s) and up to ____ secondary devices.
    8·1 answer
  • What are two types of crust on the earths surface
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!