Question: 6. Modify the addfrac.c program of Section 3.2 so that the user enters both fractions at the same time, separated by a plus sign: Enter

 6. Modify the addfrac.c program of Section 3.2 so that the

user enters both fractions at the same time, separated by a plus

6. Modify the addfrac.c program of Section 3.2 so that the user enters both fractions at the same time, separated by a plus sign: Enter two fractions separated by a plus sign: 5/6+3/4 The sum is 38/24 2 /* Adds two fractions 3 4 #include 5 6 int main(void) 7. { 8 int numi, denomi, num2, denom2, result_num, result_denom; 9 10 printf("5/6: "); 11 scanf("%d/%d", &numi, &denomi); 12 13 printf("3/4: "); 14 scanf("%d/%d", &num2, &denom2); 151 16 result_num = num1 * denom2 + num2 * denom1; 17 result_denom denomi * denom2; 18 printf("The sum is %d/%d ", result_num, result_denom); 19 20 return 0; 21 } 22

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!