For this first assignment, you will read a fraction of the form X/Y from the keyboard, reduce it to its lowest form, and print the result. i.e. if the user enters 6/12 your program will print 1/2.

  • When your program is run, it will first print your name and rohan class account number.
  • The name of the program must be p1.c No other filename is acceptable.
  • You must place your file in top level of your account. Check this by typing:
ls -l ~/p1.c
  • If you see a file listing, your source code file has the right name, and is in the right place.
  • Your program must prompt the user to enter a fraction, and then read the input from the keyboard. This information may not be read from the command line as part of the program invocation.
  • Your program should be enclosed in a loop that asks the user if she/he wants to reduce another fraction. Thus, the user should be able to reduce an unlimited number of fractions without re-running
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.