Advertisement
Ferix

RSOJava#14

Dec 2nd, 2020
760
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.31 KB | None | 0 0
  1. import java.lang.Math;
  2. public class MyClass {
  3.     public static void main(String args[]) {
  4.         double y = 0;
  5.         for(double x=1; x < 21; x++){
  6.             System.out.println("Sum " + y + " + " + Math.sqrt(x));
  7.             y = y + Math.sqrt(x);
  8.             System.out.println(y);
  9.         }
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement