55 Comments

  1. Hena

    how can i download this file

    Reply
  2. 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
  3. 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
  4. Sambit

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

    Reply

  5. *
    * *
    * *
    * *
    * *
    * *
    * * * * * *

    Reply
  6. 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
  7. Vishwajit Jogalekar

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

    Reply
  8. Coner kim

    thank you veeeeeeeeeery much….. i love you

    Reply
  9. madhu

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

    Reply
  10. Gaurav More

    how to print star shape pattern in java

    Reply

  11. How to write this pattern:

    * *

    *

    * *
    Using for loop.

    Reply
  12. Ankita Gupta

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

    Reply
  13. Ambish

    Can u plz help me for this pattern

    55555
    4444
    333
    22
    1

    Reply
  14. RUPAM SADHUKHAN

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

    Reply
  15. PN

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

    Reply
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. Kajal

    Can u hepl with the following pattern
    A
    BA
    CBA
    DCBA

    Reply
  22. Shreyashi Mukherjee

    I
    IC
    ICS
    ICSE

    Reply
  23. google user

    how to print
    Y
    PY
    PPY
    APPY
    HAPPY

    Reply
  24. yankho

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

    Reply
  25. 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
  26. oumar

    hello could u helps me out ….
    this pattrn

    11
    2112
    321123
    43211234

    Reply
  27. dhanu

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

    Reply
  28. 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
  29. 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
  30. 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
  31. Shiv

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

    Reply
  32. 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