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
IRINA_888 [86]
3 years ago
13

Write a C++ program to read N numbers. Find sum, product, and average of N numbers

Computers and Technology
1 answer:
netineya [11]3 years ago
3 0

Answer:

// here is code in c++

// headers

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

   int n,num;

   double sum=0, avg;

   long long int prod=1;

   cout<<"Enter value of N:";

   // read value of N

   cin>>n;

   cout<<"enter "<<n<<" numbers:";

   // read the N numbers

   for(int x=0;x<n-1)

   {

    cin>> num;

    // calculate sum of all

    sum=sum+num;

    calculate product of all

    prod=prod*num;

   }

   // print sum

   cout<<"sum of all "<<n<<" numbers is: "<<sum<<endl;

   // print product

   cout<<"product of all numbers is : "<<prod<<endl;

   print average

   cout<<"average of all "<<n<<" numbers is: "<<sum/n<<endl;

return 0;

}

Explanation:

Read the value of n from user.Then ask user to enter n numbers. Then calculate sum of all entered number and their product.After this calculate the average of entered number by dividing sum with n.Print sum, product and average of n numbers.

Output:

enter value of N:6

enter 6 numbers:1 2 3 4 5 6

sum of all 6 numbers is: 15

product of all numbers is : 120

average of all 6 numbers is: 2.5

You might be interested in
which of the following uses technical and artistic skills to create visual products that communicate information to an audience?
hoa [83]

Answer:

grafic desiner

Explanation:

just a guess lol

7 0
4 years ago
A gui allows you to interact with objects on the screen such as icons and buttons true or false
gizmo_the_mogwai [7]
The answer to your question is true
5 0
3 years ago
how do i create an advanced search using the search criteria in the range K2:S3 and the inventory data where the results will be
valentina_108 [34]

Create an advanced search using the search criteria in the range K2:S3 and the inventory data where the results will be displayed in the search results (starting in cell K10).

Explanation:

  • In cell B2, enter the value from A7.
  • Insert a function in D2 that will return the arrival date of any vehicle based on  which VIN is entered in B2 (Hint: Start with an INDEX function. Before you use a  nested MATCH function, specify which column number you will be returning.)
  • Insert a function in F2 that will return the Special Notes of any vehicle based on  which VIN is entered in B2 (Use the same hint from the previous step.)
  • Enter the following values for the advanced search criteria in the range K3S3:
  1. Year = 2018
  2. Type = Sedan
  3. GPS = Yes
  • Create an advanced filter using the search criteria in the range K2:S3 and the  inventory data where the results will be displayed in the search results (starting in  K10).
  • Verify results populate as expected.
6 0
3 years ago
An attacker has obtained the user ID and password of a data center's backup operator and has gained access to a production syste
solong [7]

Answer:

D.

Explanation:

Based on the information provided surrounding this scenario, it can be said that the most likely next course of action would be to create an alternate user ID to maintain persistent access. This would allow the attacker to have continuous access into the network in the case that the system administrators detect that the operator's user ID and password have been compromised. Thus also giving the attacker ample time to infiltrate and find vulnerabilities in the network through an alternate hidden user ID.

3 0
4 years ago
To make sound decisions about information security, management must be informed about the various threats facing the organizatio
const2013 [10]

Answer:

The answer is A. True

Explanation:

It is the responsibility of management to be aware of the current and potential threats that the organization is facing or prone to face in the nearest future. The threats could be focused on data integrity, valuable information, applications, or human personnel.

Hence, to make adequate decisions on information security, the management must take an assessment of the current situation of the organization and make plans towards securing the organization.

8 0
3 years ago
Other questions:
  • A rectangular box that displays information or a program is called
    13·1 answer
  • Place the steps in order to keep a graphic from spilling over into the next page and to include the text it is assciated with.
    12·1 answer
  • Why were american colonists unhappy with king george iii?
    6·2 answers
  • Universal Containers uses a custom object within the product development team. Product development, executives, and System Admin
    11·1 answer
  • Create a parent class called Shape with width and height parameters of type double and a function that returns the area of the s
    12·1 answer
  • Input a list of positive numbers, terminated by 0, into an array Numbers[]. Then display the array and the largest and smallest
    11·1 answer
  • Displays information a bout drivers, network connections, and other program-related details.
    6·1 answer
  • Schuyler is making a list of the parts of a computer that are software. Which of the following will be on the list?
    13·2 answers
  • Write a program to find all integer solutions to the equation 4x + 3y -9z = 5 for values of x, y, and z between 0 to 100.
    11·1 answer
  • Which appears at the intersection of a column and row?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!