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
Lerok [7]
3 years ago
5

Write a function named print_sum that accepts three numbers as parameters and prints the sum.

Computers and Technology
1 answer:
OLEGan [10]3 years ago
7 0

Answer:

Complete C++ code along with output and comments for explanation is provided below.

C++ Code with Explanation:

#include <iostream>

using namespace std;

// implement a function named print_sum which takes three input numbers of type int and returns the sum of these three numbers.

int print_sum(int num1, int num2, int num3)

 {

// initialize the variable to hold the value of sum

     int sum;

// add the three numbers and store the result in the variable sum

     sum = num1 + num2 + num3;

// print the sum of three numbers

     cout<<"The sum of three numbers is: "<<sum<<endl;

 }

// driver code starts here

int main()

{

// initialize the three input numbers

   int x,y,z;

// get the three numbers from the user

   cout << "Please enter number 1: "<<endl;

   cin >> x;

   cout << "Please enter number 2: "<<endl;

   cin >> y;

   cout << "Please enter number 3: "<<endl;

   cin >> z;

// call the function print_sum to calculate the sum

   print_sum(x,y,z);

   return 0;

}

Output:

Please enter number 1:

24

Please enter number 2:

13

Please enter number 3:

7

The sum of three numbers is: 44

You might be interested in
Guys I need help I cant download anything in the app store I restarted my phone and I know it's not the space on my phone I have
Simora [160]

Can you give me further explanation? For example, how is your phone not letting you download things? What model of a phone is it? what update is it on? and to what extent can you download something?

4 0
3 years ago
What is the name for the last word on a dictionary page?
kakasveta [241]

Answer:

bbbbbbbbbbbbbbbbbbbbbbbb

Explanation:

bbbbbbbbbbbbbbbbbbbbbbbbb

8 0
3 years ago
Lara sees her colleague taking a bribe from a customer. What should she do?
kondaur [170]
She should report it to the superviser
6 0
3 years ago
Read 2 more answers
Which address correctly represents one that is composed of two halves, one assigned to a network adapter manufacturer, and the o
Vlad1618 [11]
 Media access control address
5 0
3 years ago
One of the most toxic components of a computer is the _____. one of the most toxic components of a computer is the _____. plasti
erik [133]
<span>One of the most toxic components of a computer is the </span>lead embedded in the glass of the monitor.  Lead is one the toxic chemicals that can harm us.
7 0
3 years ago
Other questions:
  • Is motherboard a:<br><br> A.operating system<br> B.software<br> C.hardware<br> D.input device
    11·1 answer
  • Carmen wanted to clear up space on her computer and remove unwanted files. What would be the best for her to delete?
    6·2 answers
  • 4. When emergency changes have to be made to systems, the system software may have to be modified before changes to the requirem
    13·1 answer
  • What is the name of small programs stored on the hard drive that tell the computer how to communicate with a specific hardware d
    5·1 answer
  • How does a hard drive work
    14·1 answer
  • Explain the role of the network layer and Internet protocol (IP) in order to make internetworking possible.
    8·1 answer
  • For a new version of processor, suppose the capacitive load remains, how much more energy will the processor consume if we incre
    12·1 answer
  • Why do digital media professionals create portfolios of their work?
    5·1 answer
  • An individual involved with the aspect of a project will be concerned with budgets and the costs associated with running a busin
    10·2 answers
  • This is a glitch ? 


 










































    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!