Finding Roots

Finding Roots - double x2 = (-b - Math.sqrt(Math.pow(b, 2)...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* *Getting to the roots */ package findingroot; /** * * @author Manny */ public class FindingRoot { /** * @param args the command line arguments */ public static void main(String[] args) { // Input int a = 2; int b = 6; int c = -8; //Process double x1 = (-b + Math.sqrt(Math.pow(b, 2) - 4*a*c)) / (2*a);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: double x2 = (-b - Math.sqrt(Math.pow(b, 2) - 4*a*c)) / (2*a); // Output System.out.println("the first root is: " + x1); System.out.println("the second root is : " + x2); } }...
View Full Document

Ask a homework question - tutors are online