Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Hello{
- public static void main(String[] arg) {
- int a=1, b=4,c=3;
- System.out.println (a+"x^2+"+b+"x+"+c+"=0");
- int D=b*b-4*a*c;
- System.out.println (D);
- if (D>=0) {
- double x1=((-b+Math.sqrt(D))/2/a);
- double x2=((-b-Math.sqrt(D))/2/a);
- System.out.print ("First "+x1+" Second "+x2);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement