Question: Write a C++ program to perform the following tasks: Create (define) three functions called sum. Differentiate the functions by the number and type of arguments

Write a C++ program to perform the following tasks:

Create (define) three functions called "sum". Differentiate the functions by the number and type of arguments

a. first function - accepts two integer arguments and returns an integer sum b. second function - accepts one integer argument that is passed by reference.It should increment the value of the argument by 5 and returns nothing c. third function - accepts one integer and one double argument and returns a double sum 

In the main function

a. call function1 with arguments 6 and 9. Print the returned value.

b. call function 2 with an integer variable s as its argument (assign a value of 8 to it before calling the function). Print the changed value of s.

c. call function 3 with 12 and 3.5 as arguments. Print the returned value.

All values must be printed on a new line

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!