/*********************************************************** binomial-product.ch Binomial Product This program calculates the binomial product of an equation of the form: (ax + b)(cx + d) = acx^2 + adx + bcx + bd ************************************************************ 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 double a,b,c,d,firstterm,secondterm,thirdterm; printf("Refer to the expression (ax + b)(cx + d)"); //Get the values printf("\nWhat is a? "); scanf("%lf",&a); printf("What is b? "); scanf("%lf",&b); printf("What is c? "); scanf("%lf",&c); printf("What is d? "); scanf("%lf",&d); //Calculate terms firstterm = a*c; secondterm = a*d + b*c; thirdterm = b*d; //Display equation printf("The binomial product is: %.2lf x^2 + %.2lf x + %.2lf\n", firstterm, secondterm, thirdterm);