document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import java.io.BufferedReader;
  2. import java.io.InputStreamReader;
  3.  
  4. public class GeneratePyramidExample {
  5.        
  6.         public static void main (String[] args) throws Exception{
  7.                
  8.                 BufferedReader keyboard = new BufferedReader (new InputStreamReader (System.in));
  9.                
  10.                 System.out.println("Enter Number:");
  11.                 int as= Integer.parseInt (keyboard.readLine());
  12.                 System.out.println("Enter X:");
  13.                 int x=   Integer.parseInt (keyboard.readLine());
  14.                  
  15.                 int y = 0;
  16.                
  17.                 for(int i=0; i<= as ;i++){
  18.                        
  19.                         for(int j=1; j <= i ; j++){
  20.                                 System.out.print(y + "\\t");
  21.                                 y = y + x;
  22.                         }
  23.                        
  24.                         System.out.println("");
  25.                 }
  26.         }
  27. }
');