Question: please write in c language , and run all these sample,thanks 2. Write a C program that implements a basic calculator for fractions, including addition,
2. Write a C program that implements a basic calculator for fractions, including addition, subtraction, multiplication, and division. You should read two frac- tions and an operation from the user, and output the correct answer in lowest terms. The conversion to lowest terms should be performed by a separate func- tion. Your fractions should be stored using a data structure. Sample input/output 1 Enter fraction1 op fraction2 1/2 3/4 The result is: 5/4 input/output 2: Enter fractioni op fraction2 5/4 2/3 The result is: 5/6 Sample input/output 3: Enter fraction1 op fraction2 4/3%. 1/5 Invalid operator
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
