#include<stdio.h>#include<math.h>intmain(){float a, b, c;float discriminant, root1, root2;// Input coefficients from userprintf("Enter coefficients a, b, and c: ");scanf("%f %f %f",&a,&b,&c);// Calculate discriminant discriminant = b * b -4* a * c;// Check the nature of rootsif(discriminant >0){// Real and distinct roots root1 =(-b +sqrt(discriminant))/(2* a); root2 =(-b -sqrt(discriminant))/(2* a);printf("Roots are real and distinct: %.2f and %.2f\n", root1, root2);}elseif(discriminant ==0){// Real and equal roots root1 = root2 =-b /(2* a);printf("Roots are real and equal: %.2f and %.2f\n", root1, root2);}else{// Imaginary rootsfloat realPart =-b /(2* a);float imaginaryPart =sqrt(-discriminant)/(2* a);printf("Roots are complex: %.2f + %.2fi and %.2f - %.2fi\n", realPart, imaginaryPart, realPart, imaginaryPart);}return0;}