76 248
Assignments Done
Successfully Done
In May 2019

Answer to Question #38706 in C++ for Diamond Griffin

Question #38706
Create a program that asks the user for two integers which represent the numerator and denominator parts of fraction.
Print out a simplification of the fraction.
Enter the numerator: 22
Enter the denominator: 5
22/5 is 4 and 2/5
Expert's answer
#include <stdio.h>

int main() {
int numerator, denominator;

scanf("%d %d",&numerator, &denominator);

printf("%d/%d is %d and %d/%d", numerator, denominator, numerator/denominator, (numerator%denominator), denominator);

return 0;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions