Guest User

Untitled

a guest
Feb 25th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. System.out.println("Wtite Number");
  6. Scanner in = new Scanner(System.in);
  7. int NumberOfValues = in.nextInt();
  8. double Result = 0;
  9. double Dividend = 1;
  10. double Divider = 7;
  11. for(int i=0;i<NumberOfValues;i++){
  12. Result = Result + (Dividend/Divider);
  13. Dividend++;
  14. Divider = Divider + 2;
  15. }
  16. System.out.println("Result = " + Result);
  17. }
  18. }
Add Comment
Please, Sign In to add comment