C++ Programming Blog

 
 
 

Image

 #include<iostream.h>
 #include<conio.h>

 int vol(int=1,int=2,int=3);

 main()
    {
       clrscr();

       int length;
       int width;
       int height;
       int volume;

       cout<<\"\\n Enter the value of length = \";
       cin>>length;

       cout<<\"\\n Enter the value of width = \";
       cin>>width;

       cout<<\"\\n Enter the value of heigth = \";
       cin>>height;

       volume=vol();
       cout<<\"\\n Volume with no argument passed = \"<<volume<<endl;

       volume=vol(length);
       cout<<\"\\n Volume with one argument passed = \"<<volume<<endl;

       volume=vol(length,width);
       cout<<\"\\n Volume with two argument passed = \"<<volume<<endl;

       volume=vol(length,width,height);
       cout<<\"\\n Volume with all argument passed = \"<<volume<<endl;

       getch();
       return 0;
    }


 //---------------------------  vol(int, int, int)  ----------------------//


 int vol(int l,int h,int w)
    {
       return l*h*w;
    }

    Related Post:
  1. Program to illustrate the binary operator(-) overloading by creating an object of that class

  2. Program to estimate the value of Second Derivative of the function at the given points from the given data using Central Difference Formula of order 2

  3. Problem you will be analyzing a property of an algorithm whose classification is not known for all possible inputs

  4. Program that performs array operations like insert,delete, search, sort, merge and display

  5. PROGRAM FOR LL(1) PARSING

  6. Program to read a Linear System of Equations,then evaluate it by using Gauss-Elimination Method and show the result

  7. Program to illustrate unary operator(decrement operator) overloading without return type

  8. Program to count number of words, lines and characters in given string

  9. Program to estimate the Differential value of the function at the given point from the given data using Mid-Point Method

  10. Program to perform quick sort

  11. Program to convert an Infix Expression into a Postfix Expression using Linked List as a Stack

  12. Program to add two integers without using + operator

  13. Program to find largest integer among the three and display it using function with return type

  14. Program to illustrate the use of call-by-refrence method in functions

  15. Program to estimate the value of Second Derivative of the function at the given points from the given data using Central Difference Formula order 4

  16. Program of LL parser1

  17. Program of Minimum Spaning Tree ( MST )

  18. Program to illustrate the use of parameterless function

  19. Program to illustrate the binary operator(+) overloading by creating a new object

  20. Program of text box

 
 
Didn't find what you were looking for? Find more on Program to illustrate the use of default argument function