I need help with programming because its almost the end of the semester and I still have no clue how to write code. My professor gave us an assignment and I dont know how to do it so if you could help me I would greatly appreciate it. Here is the code.
Write a program that will reduce a fraction to its lowest components.
First, write a function greatest common divider that takes two integer arguments, u and v, and does the following computation:
Step1: If v is zero, return zero.
Step2: Set u=|u| and v=|v|.
Step3: If u is zero, return zero.
Step4: Set r=u mod v, u=v, v=r, and return to step3.
The results is the greatest common divisor of u and v.
Write a main function that will let you enter two intergers repeatedly. End the loop if one of the intergers is zero.
For the two intergers entered, find the greatest common divisor, divide it into the two intergers, and display the results.