Find the quadratic equation from the given roots | C ++ implementation of the approach ; Function to find the quadratic equation whose roots are a and b ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void findEquation ( int a , int b ) { int sum = ( a + b ) ; int product = ( a * b ) ; cout << " x ^ 2 ▁ - ▁ ( " << sum << " x ) ▁ + ▁ ( " << product << " ) ▁ = ▁ 0" ; } int main ( ) { int a = 2 , b = 3 ; findEquation ( a , b ) ; return 0 ; }