Wednesday, November 18, 2015

Pattern Using BlueJ On Numbers


3 3 3
5 5 5 5 5
7 7 7 7 7 7 7


import java.io.*;
class A
{
int i,j,r,col=3;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
 public void take () throws Exception
 {
    System.out.println("How many rows:");
    r=Integer.parseInt(br.readLine());
    for( i=0;i< r;i++)
    {
    for(j=0;j< col;j++)
    {
    System.out.print(col);
    }
    col=col+2;
    System.out.println();
    }
   }
   public static void main(String args[]) throws Exception
   {
    A object=new A();
    object.take();
    }
    }

Related PostBlueJ Programs On Pattern

No comments:

Post a Comment

Subscribe via email

Enter your email address:

Delivered by FeedBurner