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
A __________ search engine focuses on a specific subject.<br><br>answer : Specialized
natita [175]

Answer:

Specialized fr just want point lol

Explanation:

5 0
3 years ago
The Twitter website has become a de facto first source for many important events in the last decade. Twitter's hashtag feature l
timurjin [86]

Answer:

..........................................?

7 0
3 years ago
Read 2 more answers
Polymorphic refers to a malware's ability to:
harkovskaia [24]
Polymorphism is malware's ability to change the way it appears on different computers. This makes it very difficult for antivirus software to identify the malware.
7 0
3 years ago
Read 2 more answers
Which of the following is an example of cyberharassment?a. Someone sends you a credible threat that they are "out to get you."b.
Marta_Voda [28]

Answer:

D

Explanation:

In order for it to be considered harassment, it has to happen on more than one occasion.

7 0
3 years ago
Read the data file to a data frame ss16wa, and only retain columns "PWGTP", "AGEP", "WAGP", "VALP", "WKHP", "CIT", "ACCESS". (2)
Murrr4er [49]

Answer:

Data Frame

A data frame is used for storing data tables. It is a list of vectors of equal length. For example, the following variable df is a data frame containing three vectors n, s, b.

> n = c(2, 3, 5)

> s = c("aa", "bb", "cc")

> b = c(TRUE, FALSE, TRUE)

> df = data.frame(n, s, b)       # df is a data frame

Built-in Data Frame

We use built-in data frames in R for our tutorials. For example, here is a built-in data frame in R, called mtcars.

> mtcars

              mpg cyl disp  hp drat   wt ...

Mazda RX4     21.0   6  160 110 3.90 2.62 ...

Mazda RX4 Wag 21.0   6  160 110 3.90 2.88 ...

Datsun 710    22.8   4  108  93 3.85 2.32 ...

              ............

The top line of the table, called the header, contains the column names. Each horizontal line afterward denotes a data row, which begins with the name of the row, and then followed by the actual data. Each data member of a row is called a cell.

To retrieve data in a cell, we would enter its row and column coordinates in the single square bracket "[]" operator. The two coordinates are separated by a comma. In other words, the coordinates begins with row position, then followed by a comma, and ends with the column position. The order is important.

Explanation:

4 0
3 years ago
Other questions:
  • If an application written for an earlier version of Windows doesn't run correctly the operating system can emulate its own older
    5·1 answer
  • The memory allocated for a float value is ____ bytes.
    9·1 answer
  • Select the proper ergonomic keyboarding techniques.
    15·2 answers
  • Which element of presentation software can you use to add callouts and banners?
    5·2 answers
  • What do character formats do for your document's message? A. Set how text aligns within a document B. Provide organization C. Pr
    6·2 answers
  • Contains the instructions your computer or device needs to run programs and apps
    5·1 answer
  • For the preceding simple implementation, this execution order would be nonideal for the input matrix; however, applying a loop i
    6·1 answer
  • c++ Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value is c
    14·2 answers
  • Disrupting a business's ability to conduct electronic commerce is cönsidered an act of
    6·1 answer
  • Who has pad let and wants to talk
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!