Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdlib>
- #include<cmath>
- int main()
- {
- double a, b, c, x1, x2;
- std::cout<<"Helloworld"<<std::endl;
- a=2.00;
- b=8.00;
- c=6.00;
- std::cout<<"Heres the quadratic formula:"<<std::endl;
- std::cout<<a<<"x^2"<<'+'<<b<<'x'<<'+'<<c<<endl;
- x1=b+(sqrt(pow(b, 2)-4*a*c))/(2*a);
- x2=-b+(sqrt(pow(b, 2)-4*a*c))/(2*a);
- std::cout<<x1<<" or"<<x2<<endl;
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement