Question
Fractional Numbers with Structure (20 points) Create a structure called Fraction to store fractions having numerator and denominator (both of them are integers). Given a
Fractional Numbers with Structure (20 points) Create a structure called Fraction to store fractions having numerator and denominator (both of them are integers). Given a command and a pair of fractions, execute the command using the following functions that you have to implement. (a) Fraction addition(Fraction a, Fraction b) (b) Fraction subtraction(Fraction a, Fraction b) (c) Fraction multiplication(Fraction a, Fraction b) (d) Fraction division(Fraction a, Fraction b) Your code should contain a main() function where you will take inputs from a file named input.txt and write outputs to a file named output.txt. All your inputs will be valid fractions, so no need to check for divide by zero error.
C language only please.
Input Format The first line contains a single integer T, denoting the number of test cases. (1 denominator, separated by a space. The possible commands are Command Instruction Example Example Explanation input output 1/2 1/4- 3/4 Add the two fractions 1 2 14 3 4 Subtract the second fraction 3 4 1 2 from the first fraction 1/4 Multiply the two fractions5 10 14711 5/10 * 14/7 Divide the first fraction by the123 4 2 3 1/23/4 second fraction 2/3Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started