Math Calculator
40 points
You are to create a menu-driven program that will perform each of these operations:
q. Quit
The following conditions must be met:
Euclid's Algorithm to find the Greatest Common Factor of two non-negative integers
if x < y,
swap x and y // x is the larger of the two integers
while y != 0
remainder = x mod y
x = y
y = remainder
return
x
You must name your project "project3.c".
C Language Hints
Note that while functions are required, no parameter passing is required. The function should prompt for the inputs it needs and display its results. You may want to write an additional function to display the menu. The main() function is responsible for displaying the menu, or calling a function that does so, interpreting the choice, and calling the correct function for each menu section, excluding Q which exits the program.
Does it appear that the menu selections are all numeric? While there are seven numeric menu selections, 'q' or 'Q'are not, so it is best to consider all menu inputs as character instead of numbers. Working with a single digit number is as easy as working with an integer, just test for '1' instead of 1, '2' instead of 2, etc.
At the top of this program put the following comments:
| Correct Result | 20 points |
| Readability (Code and Output) | 20 points |
Last Revised: 10/03/2007 07:51 AM