// The following code uses a function to divide two numbers.
 #include<iostream.h>

float Divide_xy(float x, float y)
{
      if( y == 0){ // To make sure that you will not divide by 0
          cout << “Division by 0 is not defined \n”;
           return 0;
      }
       else
            return x/y;
}

int main( )
{
      float x, y;
 
      cout << “Enter values of x and y \n”;
      cin >> x >> y;

      cout << “The answer for” << x << “/“ << y << “ is: “ << Divide_xy(x,y);
 
      return 0;
}