Question
Write two functions having the same name Add and both take two parameters. When called from main, they will print I have been called n
Write two functions having the same name Add and both take two parameters. When called from main, they will print I have been called n times where n is the number of calls, they have received from main, and will return the sum of arguments passed. Note: Keep taking input until the user enters -1. Example Output: Add(12,12); Sum = 24, I have been called 1 time Add(45,1254); Sum = 1299, I have been called 2 times Add(45.89,12.45); Sum = 58.34, I have been called 1 time Add(1,15); Sum = 16, I have been called 3 times (This was dummy output; you are supposed to take input from the user and add them until the user enters -1)
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