Program to find number of solutions in Quadratic Equation | C # Program to find the solutions of specified equations ; Method to check for solutions of equations ; If the expression is greater than 0 , then 2 solutions ; If the expression is equal to 0 , then 2 solutions ; Else no solutions ; Driver Code
using System ; class GFG { static void checkSolution ( int a , int b , int c ) { if ( ( ( b * b ) - ( 4 * a * c ) ) > 0 ) Console . WriteLine ( "2 ▁ solutions " ) ; else if ( ( ( b * b ) - ( 4 * a * c ) ) == 0 ) Console . WriteLine ( "1 ▁ solution " ) ; else Console . WriteLine ( " No ▁ solutions " ) ; } public static void Main ( ) { int a = 2 , b = 5 , c = 2 ; checkSolution ( a , b , c ) ; } }