Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. import javax.swing.*;
  2. public class Countingloopsex2 {
  3.     public static void main(String[] args) {
  4.        
  5.         int fn = 1;
  6.         double sn = 1;
  7.         int bp1;
  8.         int bp2 = 1;
  9.         double bp6 = 0;
  10.         double bp4 = 1;
  11.        
  12.        
  13.         bp1 = Integer.parseInt( JOptionPane.showInputDialog("Enter first number: " ));
  14.        
  15.        
  16.         while (bp2 <= bp1 ){
  17.            
  18.         double bp3 = bp4 / (sn+1)  ;
  19.         double bp5 = bp6 + bp3;
  20.         bp2++;
  21.         System.out.println(bp5);   
  22.            
  23.         }
  24.        
  25.    
  26.  
  27.     }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement