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
I plugged my phone up into a charger, the charger sparked and i unplugged my phone and now it wont charge at all, does anyone kn
tamaranim1 [39]
The most probable answer is that their was a short on the charger causing your phone's charging port to blow out. You can fix this yourself with a hot air soldering gun to remove the charging port and replace it with an identical port but it is not recommended if you have a warranty. As for prices it depends on the phone.
4 0
3 years ago
How is sharepoint used in organization today?
tatyana61 [14]
<span>To build a team site and collaborate with your colleagues</span>
8 0
3 years ago
You have a new phone. What determines what type of messages you can send?
prohojiy [21]
B the services provided by the provider
6 0
3 years ago
Joel has left his computer unattended while answering a phone call. A TV repairer in his house tries to surf through the applica
fomenos
The privacy-related risk that threatens Joel is the data breach. The data breach occurs when someone or an individual is likely to breach private information in which the individual is likely to stole, transmit, or gain access to someone else's data without their knowledge or knowing that someone is accessing their personal data.
6 0
3 years ago
Which two features could be added to a game using an "if () then " block
mafiozo [28]

The two features could be added to a game using an "if () then " block are:

  • Using nested If Then blocks.
  • Checks the specific Bid quantity for the instrument.

<h3>What does the If Then block mean?</h3>

The If Then block is known to be the outputs one of  a given two values, that is as a result of  the value of a Boolean input.

Note that  the input value  is very important and as such, The two features could be added to a game using an "if () then " block are:

  • Using nested If Then blocks.
  • Checks the specific Bid quantity for the instrument.

Learn more about game  from

brainly.com/question/1786465

#SPJ1

3 0
2 years ago
Other questions:
  • Which view In a presentation program displays you’re slides in full screen modes ?
    8·2 answers
  • Margins can be modified in the page layout or by using__.
    15·1 answer
  • Your task in this assignment is to exploit the race condition vulnerability in the above set-uid program. more specifically, you
    14·1 answer
  • Please help with the question no. 5 and 7 please help ​
    6·1 answer
  • I need 3 sentences on adware.<br> What they do and how they are a risk.
    5·1 answer
  • Which of the following types of computers is typically used by governments and hospitals and can support hundreds of users?
    6·2 answers
  • Select the correct answer.
    15·2 answers
  • Typing which capitals and exclamation points in an email is an example of
    14·1 answer
  • Mobile apps are replacing the old__________<br><br>​
    7·2 answers
  • Digital communication and production chapter 17
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!