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

29. Write a program that asks to input any ten numbers and displays sum of them​

Computers and Technology
1 answer:
pogonyaev3 years ago
5 0

Answer:

Here is the code for a classic C++ program that does it:

--------------------------------------------------------------------------------

#include <iostream>

using namespace std;

int main()

{

   int sum = 0;

   int n;

   cout << "Input 10 numbers: " << endl;

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

   {

       cin >> n;

       sum += n;

   }

   cout << "Sum of the numbers: " << sum << endl;

}

--------------------------------------------------------------------------------

Explanation:

I'm assuming you know what "include", "using namespace std" and "int main()" do, so I will skip over those.

First, we declare a variable "sum" and initialize it with 0 so we can add numbers to it later.

Then, we declare a variable "n" that will be set as the input of the user.

The "for-loop" will iterate ( go ) from 0 to 9, and will set the value of "n" as the input that is given -> "cin >> n;". After that, we add the value of "n" to the sum variable.

After "i" reaches 9, it will exit the loop and proceed to printing the sum of the numbers.

Hope it helped!

You might be interested in
Which implementation has the worst time complexity?
Nata [24]

Answer:

China and Michigan hskbvd

8 0
3 years ago
Consider this program segment: int newNum = 0, temp; int num = k; // k is some predefined integer value 0 while (num &gt; 10) {
Doss [256]

Answer:

All of these statements are true.

Explanation:

Since the while loop is reversing the integer number and leaving the highest order digit in the num and stores the reversed number in the newNum variable.

It skips one digit so if the num is in the range of [100,1000] it will result in a number between 10 and 100.

This loop can never go in infinite loop for any initial value of num because the loop will run as many times as the number of digits.

and if the value of the num is <=10 the while loop will never run and the value of newNum will be 0.

6 0
3 years ago
What is the term for the part of a browser responsible for reading and processing programming languages?
koban [17]
The interpreter is the answer.
4 0
3 years ago
Use the AND function with appropriate arguments in cell H11 to determine if there is a force out at third base. There is a force
Pie

Answer:

=AND($C11 = "Yes", $D11 = "Yes")

Explanation:

The AND function takes conditional inputs and tests if each of them are TRUE. If all of the inputs are TRUE, the function will output TRUE but if any one of them are not the function will output FALSE. This scales to multiple inputs but this example only has two conditions. It is important to remember that we want to compare a string so our condition must be "Yes", not just Yes.

We also use a relative cell reference, "$", on the columns C and D since we always want to use the "Runner on 1st" and "Runner on 2nd" columns.

6 0
3 years ago
To keep you from inadvertently moving controls as you work in the IDE, click the form or control, then click the _________ optio
Delicious77 [7]

Answer:

Lock Control

Explanation:

Lock Control can used to keep you from inadvertently moving controls while working in the IDE.You can do that by  clicking on the form and then click Lock control in format menu.

In visual studio you have to go to properties and and select Locked property and select True.So that it can be locked and you can unlock them also from here.

5 0
3 years ago
Other questions:
  • The device that links computers via communication lines is called the:
    15·1 answer
  • Megan has written the following rough draft for her assignment. Choose the correct way to complete each sentence. Sarah is creat
    13·1 answer
  • Many people in modern society have the notion that hard disks can be searched in an hour and files can be recovered from inciner
    10·1 answer
  • Karen is designing a website for her uncle's landscaping business. She wants to ensure that it's engaging and provides a lot of
    5·1 answer
  • Which of the following tools helps ensure your document will open in older versions of word
    13·1 answer
  • Using a third-party package of your choice, write a program that reads the contents of a csv file and saves it to an Excel file.
    10·1 answer
  • Did brainly.com go down today? i coudlnt get in it
    15·2 answers
  • Assume that x and y are boolean variables and have been properly initialized. !(x || y) || (x || y) The result of evaluating the
    10·1 answer
  • Which version of java should i use?.
    13·1 answer
  • What type of hacker is primarily motivated by an ideology, epitomizing "the ends justify the means" mentality?.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!