Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started