Kök Bulma

#include<iostream>
#include<math.h>
using namespace std;
 main(){
float a,b,c,D,Xa,Xb,K;
cout<<"a yi gir:";
cin>>a;
cout<<"b yi gir:";
cin>>b;
cout<<"c yi gir:";
cin>>c;

D=b*b-4*a*c;
cout<<"Diskiriminant:"<<D<<endl;

if(D<=0)
cout<<"kokler sanal"<<endl;

else
K=sqrt(D);
Xa=(-b+K)/2;
Xb=(-b-K)/2;

cout<<"Xa="<<Xa<<endl;
cout<<"Xb="<<Xb<<endl;
return 0;
}

Yorumlar

Bu blogdaki popüler yayınlar

1.DERS NOTU (GİRİŞ) 2018-2019 İSTE

Gün Ay Yıl Hesaplama

İskenderun Teknik Üniversitesi 2016-2017 Programlama VİZE SINAVI