/*********************************************************** multiply_fractions.ch Multiplication with Fractions This program calculates the product of two fractions ************************************************************ Copyright 2014 SoftIntegration Inc. http://www.softintegration.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 ***********************************************************/ // initialize variables int numerator1, denominator1, numerator2, denominator2; int answer_num, answer_denom; // ask user for input printf("enter the numberator of the first fraction: "); scanf("%d", &numerator1); printf("enter the denominator of the first fraction: "); scanf("%d", &denominator1); printf("enter the numerator of the second fraction: "); scanf("%d", &numerator2); printf("enter the denominator of the second fraction: "); scanf("%d", & denominator2); // calculate numerator and denominator answer_num = numerator1*numerator2; answer_denom = denominator1*denominator2; // print answer to screen printf("\nnumerator: %d\n", answer_num); printf("denominator: %d\n", answer_denom); printf("\nproduct: %d / %d\n", answer_num, answer_denom);