#include <iostream>
#include <math.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
int a,b,c;
int x1,x2;
double disk;
cout<<"\t\tPROGRAM MENCARI AKAR IMAJINATER"<<endl<<endl;
cout<<"Masukan Koefisien A: ";
cin>>a;
cout<<"Masukan Koefisien B: ";
cin>>b;
cout<<"Masukan Koefisien C: ";
cin>>c;
disk=b*b-4*a*c;
if(disk==0){
x1 =-b/2*a;
x2 =x1;
}else{
if(disk>0){
x1 =(-b+sqrt(disk))/(2*a);
x2 =(-b-sqrt(disk))/(2*a);
}else{
cout<<"Akar Imajinatier"<<endl;
}
}
return 0;
}
Comments
Post a Comment