Write A Program To Show An Example of Working of Default Arguments
This C++ program demonstrates the use of default arguments in a function. The amount() function calculates interest and takes principal, time, and interest rate as arguments, with default values of 2 years and 8% for time and rate respectively. The main() function calls amount() four times with different argument values to show the effect of default arguments.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
23 views3 pages
Write A Program To Show An Example of Working of Default Arguments
This C++ program demonstrates the use of default arguments in a function. The amount() function calculates interest and takes principal, time, and interest rate as arguments, with default values of 2 years and 8% for time and rate respectively. The main() function calls amount() four times with different argument values to show the effect of default arguments.