Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. //Úloha 9
  2. public static void main(String[] args) {
  3.  
  4. Scanner num = new Scanner(System.in);
  5.  
  6. System.out.println("Program pre výpočet kvadratickej rovnice D=b²-4ac");
  7.  
  8. //Scanner
  9. System.out.println("Zadaj a");
  10. double a = num.nextDouble();
  11. System.out.println("Zadaj b");
  12. double b = num.nextDouble();
  13. System.out.println("Zadaj c");
  14. double c = num.nextDouble();
  15. num.close();
  16.  
  17. double D = Math.pow(b,2) - (4*a*c);
  18. System.out.println("D=" + D);
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement