Top Banner
INDEX SI.N O DATE NAME OF EXPERIMENT PAGE NUMBER SIGNATURE
94
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

INDEX

SI.NODATENAME OF EXPERIMENT

PAGENUMBERSIGNATURE

C++ PROGRAMS

Function overloading using default arguments in C++

Aim:To write a c++ program for function overloading with default arguments

Algorithm:

1. Start the program2. Declare the function volume in integer data type for one argument ,in double data type for two argument and in long for three argument3. Write the function definition for the three functions with return statements4. Use the following formula to find volume of the cube (s*s*s),volume of cylinder (3.14*r*r*h) and for volume of rectangular box (l*b*h)5. Call the function in the cout statement 6. End the program.

Program coding:#include#includeInt volume(int);double volume(double,int);long volume(long,int,int);void main() {cout