שלום לכם
אני מצרף כאן מסך השאלה שלי איך אני מבטל את שתי השורות האחרונות.? #include <iostream> #include <cmath> using namespace std; void main() { double a,b,c,temp,temp1,x1,x2; cout<<"please enter the a parameter : "; cin>>a; cout<<endl; cout<<"parameter b: "; cin>>b; cout<<endl; cout<<"parameter c: "; cin>>c; if ((b*b)-(4*a*c)<0) cout<<"there is no answer for that."<<endl; else ((b*b)-(4*a*c)>0); cout<<endl; temp=(pow(b,2)-4*a*c); temp1=(sqrt(temp)); x1=((b-temp1)/(2*a)); cout<<"the x1 is: "<<x1; cout<<endl; cout<<endl; temp=(pow(b,2)-4*a*c); temp1=(sqrt(temp)); x2=((b+temp1)/(2*a)); cout<<"the x2 is: "<<x2; cout<<endl; cout<<endl; }
אני מצרף כאן מסך השאלה שלי איך אני מבטל את שתי השורות האחרונות.? #include <iostream> #include <cmath> using namespace std; void main() { double a,b,c,temp,temp1,x1,x2; cout<<"please enter the a parameter : "; cin>>a; cout<<endl; cout<<"parameter b: "; cin>>b; cout<<endl; cout<<"parameter c: "; cin>>c; if ((b*b)-(4*a*c)<0) cout<<"there is no answer for that."<<endl; else ((b*b)-(4*a*c)>0); cout<<endl; temp=(pow(b,2)-4*a*c); temp1=(sqrt(temp)); x1=((b-temp1)/(2*a)); cout<<"the x1 is: "<<x1; cout<<endl; cout<<endl; temp=(pow(b,2)-4*a*c); temp1=(sqrt(temp)); x2=((b+temp1)/(2*a)); cout<<"the x2 is: "<<x2; cout<<endl; cout<<endl; }