Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- System.out.println("Wtite Number");
- Scanner in = new Scanner(System.in);
- int NumberOfValues = in.nextInt();
- double Result = 0;
- double Dividend = 1;
- double Divider = 7;
- for(int i=0;i<NumberOfValues;i++){
- Result = Result + (Dividend/Divider);
- Dividend++;
- Divider = Divider + 2;
- }
- System.out.println("Result = " + Result);
- }
- }
Add Comment
Please, Sign In to add comment