Reduce the fraction to its lowest form | C ++ program to reduce a fraction x / y to its lowest form ; Function to reduce a fraction to its lowest form ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void reduceFraction ( int x , int y ) { int d ; d = __gcd ( x , y ) ; x = x / d ; y = y / d ; cout << " x ▁ = ▁ " << x << " , ▁ y ▁ = ▁ " << y << endl ; } int main ( ) { int x = 16 ; int y = 10 ; reduceFraction ( x , y ) ; return 0 ; }