Showing posts with label PATTERN. Show all posts
Showing posts with label PATTERN. Show all posts

Java Program to print pattern

♠ Posted by ANDROID THIRST in













Program to create this pattern in java is :-

public class Pattern1 {
    public static void main(String[] args) {
        int r=14;
        for(int i=1;i<=5;i++){
            for(int j=1;j<=r;j++){
                System.out.print("-");
            }
            for(int k=1;k<=i;k++){
                System.out.print("#");
            }
            r=r-2;
            System.out.println();
        }
    }
   
}
   
"HAPPY PROGRAMMING"

How to create Number Pattern in Java?

♠ Posted by ANDROID THIRST in












A number pattern in java is a simple program    that is asked by the programmer to check their command on the loop. Here I described how to  create a simple number pattern in java. There are following step you need to follow to create a number pattern.
1. Have a clear perception in your mind what you want to create.
2. Don't just create Take a copy pen and firstly create it on your copy
3. Draw this practice more and more


public class numExample {
   static int i;
   static int j;
    public static void main(String[] args) {
       
        for(i=1; i<=5; i++)
               {
              for(j=1;j<=i;j++)
              {
                 System.out.print(j);  
       }
            System.out.println("");
           
        }
    }



"HAPPY PROGRAMMING"