Reducing fraction

Reducing fraction

Algorithm:

  • get values from the user
  • store them in some temporary variable's
  • get a reminder by dividing the denominator with numerator 
  • assign value to a variable
  • assign that value to b variable
  • repeat step 3, 4, 5 till b is not equal to 0
  • divide the original values with the value of we will get reduce form 
Program




Output:



Reference:
   Data Structure using c and c++, second edition Langsam, Y. and Augenstein.

Comments