Calculate The Serious Program Using Java

  1. // serious program  
  2. import java.io.*;  
  3. import java.text.*;  
  4. import java.lang.Math;  
  5.   
  6. class ssva8  
  7. {  
  8.     public static void main(String arg[]) throws IOException  
  9.     {  
  10.           
  11.         double i=1.0,j=0.1;  
  12.         BufferedReader obj=new BufferedReader(new InputStreamReader(System.in));  
  13.         System.out.print("\nENTER THE VALUE N>1.0 : ");  
  14.         double n=Double.parseDouble(obj.readLine());  
  15.         System.out.print("\nENTER THE VALUE M>0.1 : ");  
  16.         double m=Double.parseDouble(obj.readLine());  
  17.         System.out.println("\n");  
  18.         NumberFormat nf= NumberFormat.getInstance();  
  19.         for(i=0.0;i<=n;i=i+1.0)  
  20.         {  
  21.             for(j=0.0;j<=m;j=j+0.1)  
  22.             {  
  23.                 System.out.print(nf.format(Math.sqrt(i+j))+ "  ");  
  24.             }  
  25.             System.out.println("\n");  
  26.         }  
  27.     }