Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program that implements fraction numbers. Your structure should have two fields: numerator and denominator. Remember that a denominator should never be 0.

Write a C program that implements fraction numbers. Your structure should have two fields: numerator and denominator. Remember that a denominator should never be 0.

You need to implement the following operations:

Add two fractions

Subtract two fractions.

Multiply two fractions

Divide two fractions.

You need to implement a function for each one of these operators.

You main function will need to call these functions.

You main function will have an infinite loop with the following menu:

Add two fractions

Subtract two fractions.

Multiply two fractions

Divide two fractions. (you can do it at Home)

Quit

You would need to ask the user to input both the numerator and the denominator and ask the user for the operation number (1 for add, 2 for sub, 3 for mult, and 4 for div). The program then prints the outcome of the operation.

The infinite loop will terminate if the user input 5.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How Do I Use A Database Research Tools You Can Use

Authors: Laura La Bella

1st Edition

1622753763, 978-1622753765

More Books

Students also viewed these Databases questions

Question

Why should all firms prepare a cash budget?

Answered: 1 week ago