Answer to Question #38402 in C++ for Prateek

Question #38402
CALCULATE INTEREST AMOUNT USING FUNCTION OVERLOADING
1
Expert's answer
2014-01-20T11:05:35-0500
#include <cstdlib>
#include <iostream>
using namespace std;
int amount(int a) {
cout << "Function with one argument" << endl;
return 1;
}
int amount(int a, double b) {
cout << "Function with two arguments" << endl;
return 2;
}
int main() {
int a = 10;
double b = 25.5;
cout << "Amount: " << amount(a) << endl;
cout << "Amount: " << amount(a, b) << endl;
return 0;
}
18:02

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS