C++ Programming

Function Overloading that Converts Fit into Inches

Function Overloading

Write a Program using the function overloading that converts fit into inches. Use function with no arguments, one argument and two arguments. Decide yourself the types of arguments. Use pass by reference in one of the function above.

Source Code

float x,f;
void main()
 float length();
 float length(float &x);
 float length(float x,float y);
 cout<<"Enter length in feet"<<endl;
 cout<<"without using arguments"<<f<<endl;
  cout<<"using one argument"<<f<<endl;
  cout<<"using two arguments"<<f<<endl;
 float length()
 return (x*12);
 float length(float &a)
  return (a*12);
 float length(float a,float b)
 return (a*b);


About Author

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.

You may also like

program to find leap year
C++ Programming

C++ Program to Find Leap Year by Using Function

  • March 3, 2016
Write a program to find if the inputted year is a leap year or not by using the concept of