Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. package Prov;
  2.  
  3. public class Prov_Repetition_uppgift3 {
  4.  
  5. public static void main(String[] args) {
  6. //deklarationer
  7. double total = 0;
  8. //inmatningar
  9. for (int i = 4; i < 20; i++) {
  10. System.out.println(2.0/i);
  11. total += 2.0/i;
  12.  
  13. }
  14. //beräkningar
  15. //utmatning
  16. System.out.println("summan är " + total);
  17.  
  18. }
  19.  
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement