Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package trp.pi;
- public class Main {
- public static void main(String[] args){
- double pi = 0;
- double x = 0;
- do{
- x += 4;
- pi += (4 / (x-3)) - (4 / (x-1));
- System.out.println(x + " <- x ..... pi -> " + pi);
- }while(x>-1);
- System.out.println("pi = " + pi);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement