# data[].attributes.body
20EER058
#include<stdio.h>
#include<math.h>
inter main()
{
float a, b, b, d, root1, root2, real, imagine;
print f("enter the value of a, b, c") ;
scanf("%f%f%f", &a, &b, &c) ;
d=b*b-4*a*c;
IF(d>0)
root1=((-b+sqrt(d) /(2*a)) ;
root2=((-b-sqrt(d) /(2*a)) ;
printf("root1=%f , root2=%f", root1, root2) ;
printf("the roots are real and distinct") ;
{
ELSE IF (d==0) ;
root1=root2=(-b/(2*a)) ;
printf("roots are real and equal") ;
ELSE
real=(-b/(2*a)) ;
imagine=(sqrt((-d) /(2*a))) ;
printf("root1=%f+%f, root2=%f-%f", real, imag) ;
printf("roots are imaginary") ;
}
Return 0;
}

# data[].attributes.body
#include<studio.h>
#include<math.h>
int main()
{
float a,b,c,d,root1,root2,real,imag;
printf("Enter your value of a,b,c");
scanf("%f%f%f",&a,&b,&c);
d=b*b-4*a*c;
if ( d>0)
{
root1=(-b+sqrt(d))/(2*a);
root2=(-b-sqrt(d))/(2*a);
printf("roots are real and                           different=%f,%f",root1,root2);
}
else if(d==0)
{
root1=-(b/2*a);
root2=root1;
printf("roots are equal=%f,%f",root1,root2);
}
else(d<0)
{
real =(b/2*a);
imag=sqrt(-d)/(2*a);
printf("roots are imaginary,root1=%f+i%f,root2=%f-i%f", real,imag,real,imag);
}
return 0;
}

# data[].attributes.body
#include<math.h>
#include<stdio.h>
Int main()
{
float a.,b,c,root1,root2,real,img,i;
printf("enter the value of a,b,c");
scanf("%f%f%f",&a,&b,&c);
d=(pow(b,2)-4*a*c)/2*a;
If(d=0)
{
root1=(-b+sqrt(d))/2*a;
root2=(-b-sqrt(d))/2*a;
Printf("the roots are real and unequal");
printf("root1=%f,root2=%f",root1,root2);
}
else if(d==0)
{
root1=-b/2*a;
root2=root1;
printf("the roots are equal");
printf("root1=%f,root2=%f",root1,root2);
}
else
{
root1=real-i*img;
root2=real+i*img;
printf("the roots are imaginary");
printf("root1=%f,root2=%f",real,img,real,img;
}
return 0;
}

# data[].attributes.body
#include<stdio.h>
#include <math.h>
int main()
{
float a,b,c,d,r1,r2,real,imag;
printf("enter the coefficient values");
scanf("%f%f%f",&a,&b,&c);
d=pow(b,2)-4*a*c;
if(d>0)
{
r1=(-b+sqrt(d))/2*a;
r2=(-b-sqrt(d))/2*a;
printf("roots are real and different %f,%f",r1,r2);
}
else if(d==0)
{
r1=-b/2*a;
r2=r1;
printf("roots are equal %f,%f",r1,r2);
}
else
{
real=-b/2*a;
imag=sqrt(-d)/2*a;
printf("r1=%f+i%f,r2=%f-i%f",real,imag,real,imag);
}
return 0;
}

# data[].attributes.body
#include<stdio.h>
#include <math.h>
int main()
{
float a,b,c,d,r1,r2,real,imag;
printf("enter the coefficient values");
scanf("%f%f%f",&a,&b,&c);
d=pow(b,2)-4*a*c;
if(d>0)
{
r1=(-b+sqrt(d))/2*a;
r2=(-b-sqrt(d))/2*a;
printf("roots are real and different %f,%f",r1,r2);
}
else if(d==0)
{
r1=-b/2*a;
r2=r1;
printf("roots are equal %f,%f",r1,r2);
}
else
{
real=-b/2*a;
imag=sqrt(-d)/2*a;
printf("r1=%f+i%f,r2=%f-i%f",real,imag,real,imag);
}
return 0;
}

# data[].attributes.body
SENTHAMIL ARASU
include<studio.h>
#include<math.h>
int main()
{
float a,b,c,d,root1,root2,real,jmag,i;
printf("Enter your value of a,b,c");
scanf("%f%f%f",&a,&b,&c);
d=b*b-4*a*c;
if ( d>0)
{
root 1=(-b+sqrt(d))/(2*a);
root2=(-b-sqrt(d))/(2*a);
printf ("%f,%f roots are real and different root1=%f,root2=%f",root 1,root 2);}
else if (d==0)
{
root 1=-(b/2*a);
root2=root1;
printf ("%f,%f roots are real and different root1=%f,root2=%f",root1,root2);
}
else if (d<0)
{
real =(b/2*a);
imag=sqrt(-d)/(2*a);
printf ("root 1=%f+i%f,root2=%f-i%f", real,imag,real,imag);
return 0;}
}

# data[].attributes.body
#include <math.h>
#include <stdio.h>
int main()
{
float a, b, c, d, root1, root2, realPart, imagPart;
printf("Enter coefficients a, b and c: ");
scanf("%f %f %f", &a, &b, &c);
d = b * b - 4 * a * c;
if (d > 0)
root1 = (-b + sqrt(d)) / (2 * a);
root2 = (-b - sqrt(d)) / (2 * a);
printf("root1 = %f and root2 = %f", root1, root2);
printf("the roots are real and different");
{
else if (d == 0)
root1 = root2 = -b / (2 * a);
printf("root1 = root2 = %f;", root1);
printf("the roots are real and equal");
else
realPart = -b / (2 * a);
imagPart = sqrt(-d) / (2 * a);
printf("root1 = %f +i %f and root2 = %f -i %f", realPart, imagPart, realPart, imagPart);
printf("the roots are imaginary");
}
return 0;
}

# data[].attributes.body
include<studio.h>
#include<math.h>
int main()
{
float a,b,c,d,root1,root2,real,jmag,i;
printf("Enter your value of a,b,c");
scanf("%f%f%f",&a,&b,&c);
d=b*b-4*a*c;
if ( d>0)
{
root 1=(-b+sqrt(d))/(2*a);
root2=(-b-sqrt(d))/(2*a);
printf ("%f,%f roots are real and different root1=%f,root2=%f",root 1,root 2);}
else if (d==0)
{
root 1=-(b/2*a);
root2=root1;
printf ("%f,%f roots are real and different root1=%f,root2=%f",root1,root2);
}
else if (d<0)
{
real =(b/2*a);
imag=sqrt(-d)/(2*a);
printf ("root 1=%f+i%f,root2=%f-i%f", real,imag,real,imag);
return 0;}
}

# data[].attributes.body
#include<studio.h>
# include<math.h>
int main()
{
float a,b,c,d,m,x1,x2,x,r,i;
printf("enter the value of a,b and c");
scanf("%f%f%f",&a,&b,&c);
d=b*b-4*a*c;
m=-b;
if(d>0)
{
x1=(m+sqrt(d))/(2*a);
x2=(m-sqrt(d))/(2*a);
printf("roots are real and distict");
printf("x1=%f and x2=%f",x1,x2);
}

else if (d==0)
{
printf("roots are equal and distinct");
x=m/(2*a);
printf("x=%f",x);
}
else
{
printf("roots are complex");
r=m/(2*a);
i=sqrt(-d)/(2*a);
printf("x1=%f-i%f and x2=%f+i%f",r,i,r,i)
return 0;
}

# data[].attributes.body
#include<stdio. h>
#include<math.h>
int main()
{
float a,b,c,d,root1,root2,real,imag,root1,
root2;
printf("Enter the values");
scanf("%f%f%f",&a,&b,&c);
d=b*b-4*a*c;
if(d>0)
{
root1=((-b+sqrt(d))/(2*a));
root2=((-b-sqrt(d))/(2*a));
printf("roots are real and different=%f%f" ,root1,root2);
}
else if(d=0)
{
root1=(-b)/(2*a));
root2=root1;
printf("roots are real and equal=%f%f",root1,root2);
}
else
{
real=(-b)/(2*a);
imag=(sqrt(-d)/(2*a));
printf(" root1=%f+i%f,root2=%f+i%f",
real,imag,real,imag);
}
return 0;
}

# data[].attributes.body
include<studio.h>
#include<math.h>
int main()
{
float a,b,c,d,root1,root2,real,jmag,i;
printf("Enter your value of a,b,c");
scanf("%f%f%f",&a,&b,&c);
d=b*b-4*a*c;
if ( d>0)
{
root 1=(-b+sqrt(d))/(2*a);
root2=(-b-sqrt(d))/(2*a);
printf ("%f,%f roots are real and different root1=%f,root2=%f",root 1,root 2);}
else if (d==0)
{
root 1=-(b/2*a);
root2=root1;
printf ("%f,%f roots are real and different root1=%f,root2=%f",root1,root2);
}
else if (d<0)
{
real =(b/2*a);
imag=sqrt(-d)/(2*a);
printf ("root 1=%f+i%f,root2=%f-i%f", real,imag,real,imag);
return 0;}
}

# data[].attributes.body
#include<studio.h>
#include<math.h>
int main()
{
float a,b,c,d,root1,root2,real,jmag,i;
printf("Enter your value of a,b,c");
scanf("%f%f%f",&a,&b,&c);
d=b*b-4*a*c;
if ( d>0)
{
root 1=(-b+sqrt(d))/(2*a);
root2=(-b-sqrt(d))/(2*a);
printf ("%f,%f roots are real and different root1=%f,root2=%f",root 1,root 2);}
else if (d==0)
{
root 1=-(b/2*a);
root2=root1;
printf ("%f,%f roots are real and different root1=%f,root2=%f",root1,root2);
}
else if (d<0)
{
real =(b/2*a);
imag=sqrt(-d)/(2*a);
printf ("root 1=%f+i%f,root2=%f-i%f", real,imag,real,imag);
return 0;}
}

# data[].attributes.body
#include<stdio. h>
#include<math.h>
int main()
{
float a,b,c,d,root1,root2,real,imag,i;
printf("Enter the a, b, c values");
scanf("%f %f",&a, &b);
d=b*b-4*a*c;
if(d>0)
{
root1=((-b+sqrt(d))/(2*a));
root2=((-b-sqrt(d))/(2*a));
printf("roots are real and different=%f %f" ,root1,root2);
}
else if(d==0)
{
root1=(-b)/(2*a));
root2=root1;
printf("roots are real and equal=%f %f",root1,root2);
}
else
{
real=(-b)/(2*a);
imag=(sqrt(-d)/(2*a));
printf(" root1=%f+i%f,root2=%f-i%f",real,imag,real,imag);
return 0;
}

# data[].attributes.body
# include <stdio.h>
# include <math.h>
int main()
{
float a,b,c,d,root1,root2,real,imag,i;
printf("enter your values b*b-4*a*c");
scanf("%f%f%f",&b,&a,&c);
d=b*b-4*a*c;
printf("the value of d is=%f",d);
if (d>0)
{
root1=-b+sqrt(d)/(2*a);
root2=-b-sqrt(d)/(2*a);
printf("ROOTS ARE REAL AND UNEQUAL root1=%f,root2=%f",root1,root2);}
else if (d==0)
{root1=-b/(2*a);
root2=root2;
printf("ROOTS ARE AND EQUAL root1=%f,root2=%f",root1,root2);}
else
real=-b/(2*a);
imag=sqrt(d)/(2*a);
printf("ROOTS ARE IMAGINARY root1=%f+i%f,root2=%f-i%f",real,imag,real,imag);
return 0;
}

# data[].attributes.body
#include <stdio.h>
#include <math.h>
int main()
{
  float a,b,c,r1,r2;
  printf("enter the value of a,b,c");
  scanf("%f%f%f",&a,&b,&c);
   d=b*b-4*a*c;
  if(d>0)
  {
  r1=-b+sqrt (d) /(2*a);
  r2=-b-sqrt (d) /(2*a);
  printf("the real root = %f%f",r1,r2);
  }
  else if(d==0)
  {
  r1=-b/(2*a);
  r2=-b/(2*a);
  printf("root are equal=%f%f",r1,r2);
  }
  else
  {
  printf("roots are imaginary");
   }
    return 0;
}