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
Greeley [361]
3 years ago
7

write a program in which the user can enter X amount of numbers. Once the user has enter 10 positive numbers, the user may not e

nter anymore numbers. Then the program should display the sum of those 10 positive number and also display the 10 positive numbers.
Computers and Technology
1 answer:
11111nata11111 [884]3 years ago
7 0

Answer:

The following code is in C++.

#include <iostream>

using namespace std;

int main() {

   int a[10],sum=0;//declaring an array and initialized variable sum with value 0.

   cout<<"Enter the numbers"<<endl;

   for(int i=0;i<10;i++)

   {

       cin>>a[i]; //taking input of 10 integers.

   }

   for(int i=0;i<10;i++)

   {

       sum=sum+a[i];//finding the sum..

   }

   cout<<"The sum is : "<<sum<<endl<<"The numbers entered are "<<endl;

   for(int i=0;i<10;i++)

   {

       cout<<a[i]<<" ";//displaying the elements.

   }

return 0;

}

Output:-

Enter the numbers

1 2 3 4 5 6 7 8 9 10

The sum is : 55

The numbers entered are  

1 2 3 4 5 6 7 8 9 10

Explanation:

I have taken an array of size 10 so that no more than 10 integers could fit in it.After that taking the input from the user prompting 10 integers using the for loop.After that finding the sum.Then printing the sum and the numbers entered.

You might be interested in
PLEASE HELP !!!!!! INTERNET SAFTEY
blondinia [14]
On the football field
4 0
4 years ago
Read 2 more answers
For this activity, you will practice being both proactive and reactive to bugs. Both are necessary to get rid of errors in code.
Illusion [34]

Answer:

okk

Explanation:

4 0
4 years ago
Which aspect of nature inspired the invention of Velcro
lesya692 [45]

Burrs from plants (APEX)

8 0
4 years ago
A group of researchers is designing an experiment to test whether meditation helps people fall asleep faster. The researchers se
storchak [24]

Answer:

Option 4 is the correct answer.

Explanation:

<h2>Randomization eliminates lurking variables from the experiment.</h2><h2 />

Randomization is adopted due to the fact that it removes lurking variables. By lurking variables we mean the extraneous variables which are unknown but can effect the other variables that are of interest.

Randomization is necessary in experiments to ensure that the generated result may not be biased or misleading.

<h3>I hope it will help you!</h3>
3 0
4 years ago
Specify either "Write Through" or "Write Back" as the policy which best corresponds to each of the conditions below.
Mariulka [41]

Answer:

1. Write through

2. Write back

3. Write back

4. Write through.

Explanation:

The answers are given accordingly as above.

4 0
4 years ago
Other questions:
  • A network TAP serves what purpose on a network?
    7·1 answer
  • What is the code for loading image in matlab
    15·1 answer
  • Which file extension indicates a Microsoft Excel document?
    7·1 answer
  • Which of the following would be an example of a loss of record integrity in a
    12·1 answer
  • Which devices are managed through device management? Device management is the process of managing----(blank)-----devices.
    15·1 answer
  • Assslainsdffddsvvdesdssbhasasco5m
    5·2 answers
  • Why should you be chosen over someone else? *
    5·2 answers
  • Which programming languages are the best choices for desktop applications? Select 3 options.
    8·2 answers
  • How many passes will it take to find the five in this list?
    6·2 answers
  • NAT addresses concerns over the dwindling IPv4 address space by ___________________. 1 point allowing networks to use fewer IP a
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!