Sie sind auf Seite 1von 1

###################################################################################

###################################################################################
###################################################################################
################################################################include<iostream.h>
#include<conio.h>
#include<math.h>
Void main()
{
float a,b,c,x,x1,x2,delta;
cout <<“Input a=“;cin>>a;
cout <<“Input b=“;cin >>b;
cout <<Input c=“;cin >>c;
if (a==0){

x=-c/b;
cout<<“ Result x=“<<x;
}
else {
delta=b*b-4*a*c;
if (delta==0)
cout<<“No Root!!”;
if (delta==0){
x1=-b/(2*a);
cout<<“Result x1=x2=“<<x1;
}
if (delta>0){
x1=(-b+sqrt(delta))/(2*a);
x2=(-b-sqrt (delta))/(2*a);
cout <<“Result x1=“<<x1;
cout <<“\n Result x2=“<<x2;
}
}
getch();
}

Das könnte Ihnen auch gefallen