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
Hi guts gyt edgsahgflefljwegfwygafbhdshdnvcashD
lapo4ka [179]

Hello, how are you and welcome!

4 0
3 years ago
"Explain the functionality of the different layers found in the network protocol stack of an operating system such as Linux"
arsen [322]

Answer:

There are 7 layers in linux.

Explanation:

As networking is difficult and complex.

Imagine if every application had to know how to communicate on every step that would be more than just complex. So, rather than reinvent something which will help it to communicate let’s just make something that will automatically controls the communication and for that protocols came in to live.

As for the linux operating system, it is not exceptional from other operating systems.

There are 7 layers on network protocol stack use to communicate with other network protocol stack.

1. Application layer

2. System call interface

3. Protocol agnostic interface

4. Network protocol

5. Device agnostic interface

6. Device drivers

7. Physical hardware

All the layers vary in their functionality.

One more important thing to remember is that the network protocol stack layers is not one way its 2 way communication. First, when a client request to a network and second, when the request is full filled.

The top most layer is a part of user space, the next five layers comes in the kernel space and the final layer is the physical layer.

<u>Application layer: </u>

When a client or user request to  a network the request initially comes to this layer.

On this layer we use tcp/ip protocol.

<u>System call interface(SCI): </u>

When application layer make a call to the kernel this layer handles that call. And take the request to the next layer.

<u>Protocol agnostic interface: </u>

This layer has two functions “talking” or “listening”. There is a thing called sockets which perform these functions and each socket has an id which is used specifically for an application.

<u>Network protocol: </u>

This layer is used for how the data is sent or received.

<u>Device agnostic interface: </u>

It is used to connect data from/to kernel user space and the network device drivers which allows the data to prepare itself for transmission over the medium from the network device.

<u>Physical hardware : </u>

This layer is responsible for the data packets transmission and received from the network medium being used whether cable or wireless.

5 0
3 years ago
Order the steps for accessing the junk email options in outlook 2016
Zinaida [17]

Answer:

What is the question here? lol

Explanation:

8 0
3 years ago
What trade-offs do you think engineers make between functionality, safety and aesthetics when building a real bridge?
elena55 [62]
Deciding where it should go
6 0
3 years ago
Which best describes an advantage of creating a contact group?
Lapatulllka [165]
More than one contact can be added to the group at a time.
8 0
3 years ago
Other questions:
  • Consider the two computers A and B with the clock cycle times 100 ps and 150 ps respectively for some program. The number of cyc
    5·2 answers
  • Fifty-three percent of U.S households have a personal computer. In a random sample of 250 households, what is the probability th
    11·1 answer
  • The keyboard, mouse, trackpad, microphone, light pen, and voice recognition are examples of _____ devices.
    5·1 answer
  • Many companies use software to scan resumes and search for _____________.
    10·1 answer
  • What is WEB 1.0 to WEB3.0
    11·1 answer
  • A cache has been designed such that it has 512 lines, with each line or block containing 8 words. Identify the line number, tag,
    7·1 answer
  • What is the value of the result after the following statement is executed? int result = 2 + 3 + 4 ;
    7·1 answer
  • Why is network security important? Check all of the boxes that apply. A. Network security allows organizations to continue to fu
    8·1 answer
  • Very Short Answer Type Question (any 9)
    12·1 answer
  • Explain the consequences of using bits to represent data.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!