Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SumForLoop{
- public static void main (String[] args){
- Scanner in = new Scanner(System.in);
- double answer = 0;
- for (double i = 1, j = 3; i < 99; i += 2, j += 2) {
- answer += i/j ;
- System.out.println(answer);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement