Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Prov;
- public class Prov_Repetition_uppgift3 {
- public static void main(String[] args) {
- //deklarationer
- double total = 0;
- //inmatningar
- for (int i = 4; i < 20; i++) {
- System.out.println(2.0/i);
- total += 2.0/i;
- }
- //beräkningar
- //utmatning
- System.out.println("summan är " + total);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement