75 Comments

  1. 1*1*2
    2*3*4
    3*5*6
    4*7*8
    5*9*10

    Reply
  2. KUMAR SAURAV

    Please print This pattern for me

    1
    21
    321
    4321
    54321

    Reply
    • mitu

      int i,j;
      for(i=1;i=1;j=j-1)
      {
      System.out.print(j);
      }
      System.out.println(“”);
      }

      Reply
    • Vidya sagar singh

      for (int i =1;i <=5;i++);
      {
      for (int j=i+1;j <=i;j++);
      {System.out.print (j);
      }
      System.out.println ();
      }

      Reply
  3. Sarthak

    Hey . I am sarthak.
    Pls help me for the following pattern.
    1
    10
    101
    1010
    10101

    Reply
    • mitu

      int i,j;
      for(i=1;i<=5;i++)
      {
      for(j=1;j<=i;j++)
      {
      if( j%2==0)
      {
      System.out.print("0");
      }
      else
      {
      System.out.print("1");
      }
      }
      System.out.println(" ");
      }

      Reply
  4. Tushar

    *#####
    ####**
    ***###

    Reply
  5. Shayaan Siddiqui

    Can someone do :
    54321
    4321
    321
    21
    1

    and:

    1234567
    12345
    123
    1

    Reply
  6. saravana

    how to print the following pattern
    1
    1 2 a
    1 2 3 b a
    1 2 3 4 c n a

    Reply
  7. Darpan Maskara

    77777
    76666
    76555
    76544
    76543

    Can I get solution for this plss

    Reply
  8. Sharath

    input:7
    1010101
    0101010
    1010101
    0101010
    1010101
    0101010
    1010101

    input 8:
    10101010
    01010101
    10101010
    01010101
    10101010
    01010101
    10101010
    01010101

    can anybody try the java code for this please?

    Reply
  9. Nasir

    Please send code for
    1
    11
    222
    3333

    Reply
  10. Akankshya Mondal

    * * * *
    * * * @
    * * @ @
    * @ @ @

    Reply
  11. Shubham Gupta

    Please give me a solution for the following pattern :

    43211234
    321 234
    21 34
    1 1

    Reply
  12. rahul

    ****
    ***
    **
    *
    **
    ***
    ****

    Reply

    • for(int i=1;i<=5;i++) {
      for(int j=i;j=1;i–) {
      for(int j=i;j<=5;j++) {
      System.out.print("*");
      }System.out.println(" ");
      }

      Reply
  13. Hassan Kamal

    How to print

    * *
    * *
    * * * *
    * *
    * *

    Reply
  14. Rajkumar Jain

    *
    *$*
    *$*$*
    *$*$*$*
    Plz provide solution for this pattern

    Reply
    • Nishit

      for(i=1;i<=5;i++)
      {
      for(j=1;j<=i;j++)
      {

      if(j%2==0)
      {
      System.out.print("0");
      }
      else
      {
      System.out.print("*");
      }

      }
      System.out.println("");

      }

      Reply
  15. Hena

    how can i download this file

    Reply
  16. Risa

    #@#@#
    @#@#
    #@#
    @#
    #
    Plz can i get the solution of this pattern

    Reply
    • Nikhil Jha

      import java.util.*;
      public class Pattern2 {

      public static void main(String[] args) {
      Scanner reader= new Scanner(System.in);
      System.out.println(“Enter a number:”);
      int num= reader.nextInt();
      for (int i=num;i>0;i–)
      {
      for (int j=i;j>0;j–)
      {
      if (j%2==1)
      System.out.print(“#”);
      else
      System.out.print(“@”);
      }
      System.out.println(“”);
      }
      }

      }

      Reply
  17. Sambit

    Can anyone please help me to solve this pattern:
    0
    1 1
    2 3 5
    8 13 21 35

    Reply

    • class FibPattern
      {
      public static void main(String args[])
      {
      int p=1,n=-1;
      for(int i=0; i<5; i++)
      {
      for(int j=0; j<i; j++)
      {
      int sum=p+n;
      n=p;
      p=sum;
      System.out.print(sum+" ");
      }
      System.out.println();
      }
      System.out.println();
      }
      }

      Reply
  18. Sambit

    how to print
    0
    1 1
    2 3 5
    8 13 21 35

    Reply

  19. *
    * *
    * *
    * *
    * *
    * *
    * * * * * *

    Reply
  20. meenakshi

    1 2 3 4 17 18 19 20
    5 6 7 14 15 16
    8 9 12 13
    10 11 how to print this pattern

    Reply
  21. Vishwajit Jogalekar

    Pl. Provide with program to print alphabte pyramod by taking input from user

    Reply
  22. Coner kim

    thank you veeeeeeeeeery much….. i love you

    Reply
  23. madhu

    please help me to print this code in java
    1)
    *****
    b***b
    bb*bb
    bbbbb

    Reply
  24. Gaurav More

    how to print star shape pattern in java

    Reply

  25. How to write this pattern:

    * *

    *

    * *
    Using for loop.

    Reply
  26. Ankita Gupta

    1
    2*3
    4*5*6
    4*5*6
    2*3
    1

    Reply
  27. Ambish

    Can u plz help me for this pattern

    55555
    4444
    333
    22
    1

    Reply
    • Harsh

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

      Reply
  28. RUPAM SADHUKHAN

    Can u help me?
    INPUT:
    T
    O
    U
    R
    I
    S
    T

    Reply
  29. PN

    *****
    *****
    @@@@@
    *****
    *****

    Reply
  30. Imran B

    please give a program in java that’s output is:

    1
    2 1
    3 2 1
    4 3 2 1
    5 4 3 2 1

    Reply
  31. maha

    can u please help me to print the letters M and G in stars ?Please this is urgent.

    Reply

    • no i cant help you…sorry

      Reply
  32. Tejashri

    will you please help me out with this pattern?

    1 2 3 4 5 4 3 2 1
    2 3 4 5 4 3 2
    3 4 5 4 3
    4 5 4
    5

    Reply
    • srimanta de

      plz give solved problem

      Reply
  33. Ravi

    How to print
    1
    ab
    234
    cdef
    56789

    Reply
    • SM

      #include

      int main()
      {
      int i,j,m=97,k=1;
      for(i=1;i<=5;i++)
      {
      if(i%2!=0)
      {
      for(j=1;j<=i;j++)
      {
      printf("%d" ,k);
      k++;
      }
      }
      else{
      for(j=1;j<=i;j++)
      {
      printf("%c",m);
      m++;
      }
      }
      printf("\n");
      }

      }

      Reply
  34. pritam

    Help me out
    5 4 3 2 1 * 1 2 3 4 5
    4 3 2 1 * * * 1 2 3 4
    3 2 1 * * * * * 1 2 3
    2 1 * * * * * * * 1 2
    1 * * * * * * * * * 1

    Reply
    • sudheersai

      class r
      {
      public static void main(String args[])
      {
      int s=1;
      for(int i=5;i>=1;i–)
      {
      for(int j=i;j>=1;j–)
      {
      System.out.print(j+” “);
      }
      for(int k=1;k<=s;k++)
      {
      System.out.print("* ");
      }
      for(int h=1;h<=i;h++)
      {
      System.out.print(h+" ");
      }
      System.out.println("");
      s+=2;
      }
      }
      }

      Reply
  35. Kajal

    Can u hepl with the following pattern
    A
    BA
    CBA
    DCBA

    Reply
  36. Shreyashi Mukherjee

    I
    IC
    ICS
    ICSE

    Reply
  37. google user

    how to print
    Y
    PY
    PPY
    APPY
    HAPPY

    Reply
  38. yankho

    how can I make star patterns of letters ..E.g “ABBA”

    Reply
  39. Sai Sarvani

    I need the output :10 20 30 40
    20 30 40 10
    30 40 10 20
    40 10 20 30

    Reply
    • Anirudh

      I want this program

      Reply

    • import java.util.*;
      public class PrintNumbers {
      static Scanner in=new Scanner(System.in);
      public static void main(String args[])
      {
      int num=0;
      System.out.println(“Enter the Count Of Numbers”);
      num=in.nextInt();
      System.out.println(“Enter the numbers one by one”);
      int numbers[]=new int[num];
      try
      {
      for(int i=0;i<num;i++)
      {
      numbers[i]=in.nextInt();
      }
      PrintFormat(numbers);
      }
      catch(Exception e)
      {
      System.out.println(e.getMessage());
      }

      }

      public static void PrintFormat(int number[])
      {
      try
      {
      int length=number.length;
      for(int i=0;i<length-1;i++)
      {
      int temp=number[0];
      for(int j=0;j<length-1;j++)
      {
      number[j]=number[j+1];
      System.out.print(number[j]+" ");
      }
      number[length-1]=temp;
      System.out.print(" "+temp);
      System.out.println();

      }
      }
      catch(Exception e)
      {
      e.printStackTrace();
      }

      }

      }

      Reply

    • import java.util.*;
      public class PrintNumbers {
      static Scanner in=new Scanner(System.in);
      public static void main(String args[])
      {
      int num=0;
      System.out.println(“Enter the Count Of Numbers”);
      num=in.nextInt();
      System.out.println(“Enter the numbers one by one”);
      int numbers[]=new int[num];
      try
      {
      for(int i=0;i<num;i++)
      {
      numbers[i]=in.nextInt();
      }
      PrintFormat(numbers);
      }
      catch(Exception e)
      {
      System.out.println(e.getMessage());
      }

      }

      public static void PrintFormat(int number[])
      {
      try
      {
      int length=number.length;
      for(int i=0;i<length-1;i++)
      {
      int temp=number[0];
      for(int j=0;j<length-1;j++)
      {
      number[j]=number[j+1];
      System.out.print(number[j]+" ");
      }
      number[length-1]=temp;
      System.out.print(" "+temp);
      System.out.println();

      }
      }
      catch(Exception e)
      {
      e.printStackTrace();
      }

      }

      }

      Reply
  40. oumar

    hello could u helps me out ….
    this pattrn

    11
    2112
    321123
    43211234

    Reply
  41. dhanu

    how to print
    ******
    ** **
    * *
    ** **
    ******

    Reply
  42. kanimozhi m

    1 2 3 2 1 0
    4 3
    5 6 7 6 5 4

    8*9*9*8*7 please solve this problem

    Reply
  43. vicky

    How to print this pattern
    1
    24
    135
    2468
    13579
    Guys

    Reply
    • balaji

      public class MyClass {
      public static void main(String args[]) {
      int i=1;
      int m=2;
      for (int j=1; j<=5; j++){
      int l=m;
      int p=i;
      for (int k=1; k<=j; k++){

      if ((j%2)==0){
      System.out.print(l);
      l=l+2;
      }
      if ((j%2)==1){
      System.out.print (p);
      p=p+2;
      }
      }
      System.out.println();
      }

      }
      }

      Reply
  44. Biswajit Sahu

    L
    LO
    LOT
    LOTU
    LOTUS
    PLS slove this problem

    Reply
    • balaji

      public class MyClass {
      public static void main(String args[]) {
      String s=”LOTUS”;
      char [] a=s.toCharArray();
      String n=””;
      for (int i=0; i<5; i++){
      n=n+a[i];
      System.out.println(n);

      }

      }
      }

      Reply
    • Ranjith M

      import java.util.Scanner;
      public class First {
      public static void main(String args[])
      {
      System.out.println(“Enter the String”);
      Scanner sc=new Scanner(System.in);
      String n=sc.nextLine();
      for(int i=0;i<n.length();i++)
      {
      for(int j=0;j<=i;j++)
      {
      System.out.print(n.charAt(j));
      }
      System.out.println("");
      }
      }
      }

      Reply
  45. Shiv

    ABCDEFGFEDCBA
    ABCDEF FEDCBA
    ABCDE EDCBA
    ABCD DCBA
    ABC CBA
    AB BA
    A A

    Reply
  46. siva

    ABCDE
    ABCD
    ABCD
    ABC
    AB
    A

    Reply
    • Max

      AAAAA
      ABBBB
      ABCCC
      ABCDD
      ABCDE

      Reply
      • uv

        import java.util.*;
        public class Pattern24 {
        public static void main(String[] args) {
        // TODO Auto-generated method stub
        char i,j;
        int k;
        Scanner sc = new Scanner(System.in);
        char ch = sc.next().charAt(0);
        String str =””;
        for(i=’A’;i<=ch;i++){
        for(j=i;j<=ch;j++){
        str = str+i;
        }
        System.out.println(str);
        str = str.substring(0,str.indexOf(i)+1);
        }
        }
        }

        Reply

Leave a Reply.. code can be added in <code> </code> tags