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
In photoshop what should you consider when determining a projects purpose and objectives?
Darina [25.2K]

Answer:

Identify the purpose, audience, and audience needs for preparing image,Identify three phases that might appear in a project plan. When planning your design project you might include on an outline the goals.

4 0
2 years ago
Use the following flowchart to implement a simple application that will help students decide whether computer science is a good
marissa [1.9K]

Answer:

1.yes

2.yes

3.no

4.yes

5.yes

6.yes

7.yes

8.yes

9.yes

10.yes

Explanation:

7 0
3 years ago
he timing device in an automobile’s intermittent wiper system is based on an RC time constant and utilizes a 0.500-μF capacitor
Tatiana [17]

Answer:

4000k-ohm to 10,000k-ohm

Explanation:

As we know that time constant for an RC circuit is t=RC

Putting the values of t we can get the range of varaiable resistor as;

t=RC

Putting t=2 we get the first value of the range for the variable resistor

2=R*0.500*10^-6

R=2/(0.500*10^-6)

R=4*10^6

R=4000k-ohm

Now putting t=5 we get the final value for the range of variable resistor

t=RC

5=R*0.500*10^-6

R=5/(0.500*10^-6)

R=10*10^6

R=10,000k-ohm

So variable resistance must be made to vary in the range from 4000k-ohm to 10,000k-ohm

5 0
3 years ago
Lawanda starts a new job today at a company that delivers thousands of packages each day. Identify three ways in which Lawanda's
jek_recluse [69]

Answer:

use your own opinion

Explanation:

7 0
3 years ago
What is the best method for collecting information from a source?
hichkok12 [17]
I personally think that summarizing important points is the way to go!
6 0
3 years ago
Other questions:
  • Mirrors on cars exist to____.
    7·2 answers
  • Which branch of science helps avoid or minimize stress-related injuries at workplace?
    12·2 answers
  • By using the search functionality within a twitter stream, users can filter for:
    9·1 answer
  • Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicatin
    10·1 answer
  • Signs of mastery include?
    10·1 answer
  • What is the purpose of a system call in an operating system?
    10·1 answer
  • Before measuring resistance of a component, be sure:
    8·1 answer
  • A company is developing a smart TV that connects to a wireless home network. Which technology can best help to establish this co
    11·2 answers
  • Edhesive, 8.6 question 1
    10·1 answer
  • which is a correct procedural step for a webpage to render on a user's browser? an information request is sent to an ip address
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!