Search C Program

Number Patterns


12345
1234
123
12
1
12345
2345
345
45
5
Code of above pattern


Code of above pattern


54321
4321
321
21
1
54321
5432
543
54
5
Code of above pattern


Code of above pattern


1
12
123
1234
12345
5
45
345
2345
12345
Code of above pattern


Code of above pattern


1
21
321
4321
54321
5
54
543
5432
54321
Code of above pattern


Code of above pattern


1
22
333
4444
55555
5
44
333
2222
11111
Code of above pattern


Code of above pattern


55555
4444
333
22
1
11111
2222
333
44
5
Code of above pattern


Code of above pattern


12345
4321
123
21
1
1234567
12345
123
1
Code of above pattern


Code of above pattern


1
01
101
0101
13579
3579
579
79
9
Code of above pattern


Code of above pattern


1
2 4
1 3 5
2 4 6 8
1 3 5 7 9
55555
45555
34555
23455
12345
Code of above pattern


Code of above pattern


1
23
456
78910
1
10
101
1010
10101
Code of above pattern


Code of above pattern


1 
2 6 
3 7 10 
4 8 11 13 
5 9 12 14 15
1
123
12345
1234567
Code of above pattern


Code of above pattern


12344321
123**321
12****21
1******1
    1
  2 3 4
5 6 7 8 9
Code of above pattern


Code of above pattern


1   2   3   4   5   6   7   8   9   10
36  37  38  39  40  41  42  43  44  11
35  64  65  66  67  68  69  70  45  12
34  63  84  85  86  87  88  71  46  13
33  62  83  96  97  98  89  72  47  14
32  61  82  95  100 99  90  73  48  15
31  60  81  94  93  92  91  74  49  16
30  59  80  79  78  77  76  75  50  17
29  58  57  56  55  54  53  52  51  18
28  27  26  25  24  23  22  21  20  19
Code of above pattern


11111
2222
333
22
1
5432*
543*1
54*21
5*321
*4321
Code of above pattern


Code of above pattern


1
121
12321
1234321
0 
909 
89098 
7890987 
678909876 
56789098765 
4567890987654 
345678909876543 
23456789098765432 
1234567890987654321 
Code of above pattern


Code of above pattern


1        1
12      21
123    321
1234  4321
1234554321
    1
   21
  321
 4321
54321 
Code of above pattern


Code of above pattern


1
232
45654
78910987
1
2*2
3*3*3
4*4*4*4
4*4*4*4
3*3*3
2*2
1
Code of above pattern


Code of above pattern


11
12 13
13 14 15
14 15 16 17
             1
           2 3
         4 5 6
      7 8 9 10
11 12 13 14 15
Code of above pattern


Code of above pattern


    5
   54
  543
 5432
54321
1
212
32123
4321234
Code of above pattern


Code of above pattern


1
23
345
4567
56789
  1  2  3  4  5
  6  7  8  9
 10 11 12
 13 14
 15
Code of above pattern


Code of above pattern


1234
2341
3421
4321
11111
0000
111
00
1
Code of above pattern


Code of above pattern


                  1  
              4   9  16 
         25  36  49  64  81 
    100 121 144 169 196 225 256 
289 324 361 400 441 484 529 576 625
11111
1   1
1   1
1   1
11111 
Code of above pattern


Code of above pattern


    1 
   1 2 
  1 2 3 
 1 2 3 4 
1 2 3 4 5
    1
   123
  12345
 1234567
123456789
 1234567
  12345
   123
    1
Code of above pattern


Code of above pattern


*000*000*
0*00*00*0
00*0*0*00
000***000
5 5 5 5 5 5 5 5 5 
5 4 4 4 4 4 4 4 5 
5 4 3 3 3 3 3 4 5 
5 4 3 2 2 2 3 4 5 
5 4 3 2 1 2 3 4 5 
5 4 3 2 2 2 3 4 5 
5 4 3 3 3 3 3 4 5 
5 4 4 4 4 4 4 4 5 
5 5 5 5 5 5 5 5 5
Code of above pattern


Code of above pattern


1
1 1
1 2 1
1 3 3 1 
1 4 6 4 1
1
2 4
3 6 9
4 8 12 16
5 10 15 20 25
6 12 18 24 30 36
7 14 21 28 35 42 49
8 16 24 32 40 48 56 64
9 18 27 36 45 54 63 72 81
10 20 30 40 50 60 70 80 90 100
Code of above pattern


Code of above pattern


1 
1 2 
3 5 8 
13 21 34 55 
89 144 233 377 610
11111
10001
10001
10001
11111
Code of above pattern


Code of above pattern


1 2 3 4 5 
2 1 2 3 4 
3 2 1 2 3 
4 3 2 1 2 
5 4 3 2 1 
1
3 2
4 5 6
10 9 8 7
11 12 13 14 15
Code of above pattern


Code of above pattern


1
232
34543
4567654
567898765 
1     1
 2   2 
  3 3  
   4   
  3 3  
 2   2 
1     1
Code of above pattern


Code of above pattern

1     
2 6    
3 7 10   
4 8 11 13  
5 9 12 14 15  
        1       
      1 2 1     
    1 2 3 2 1   
  1 2 3 4 3 2 1 
1 2 3 4 5 4 3 2 1
Code of above pattern


Code of above pattern

      1
    2   2
  3       3
4           4
  3       3
    2   2
      1
1  2  3  4  5  
16          6  
15          7  
14          8  
13 12 11 10 9 
Code of above pattern


Code of above pattern


N=39714

3 9 1 7 4
9 1 7 4
1 7 4
7 4
4
Code of above pattern





Related Links:
Star Patterns
http://cbasicprogram.blogspot.in/2012/03/star-patterns.html

Alphabet Patterns
http://cbasicprogram.blogspot.in/2013/03/alphabet-patterns.html

Series Programs
http://cbasicprogram.blogspot.in/2013/01/series-program.html

130 comments:

  1. thanks for this one...

    ReplyDelete
  2. please bro i need code for this pattern..

    1
    123
    12345
    1234567
    12345
    123
    1

    ReplyDelete
    Replies
    1. for(i=1;i<=7;i+=2)
      {
      for(j=1;j<=i;j++)
      printf("%d",j);
      printf("\n");
      }
      for(i=5;i>=1;i-=2)
      {
      for(j=1;j<=i;j++)
      printf("%d",j);
      printf("\n");
      }

      Delete
  3. 1 5 8 10
    2 6 9
    3 7
    4
    reply plzzzz!!

    ReplyDelete
    Replies
    1. for(i=1;i<=4;i++)
      {
      printf("%d",k=i;);
      for(j=4;j>i;j--)
      printf("%d",k+=j);
      printf("\n");
      }

      Delete
  4. ohhh!!! thanx a lot...

    ReplyDelete
  5. can any one tell how to print this patterns ?
    Q1:
    11111
    22222
    33333
    44444
    55555

    Q2:
    12345
    12345
    12345
    12345

    ReplyDelete
    Replies
    1. 11111
      22222
      33333
      44444
      55555
      for(i=1;i<=5;i++)
      {
      for(j=1;j<=5;j++)
      printf("%d",i);
      printf("\n");
      }

      12345
      12345
      12345
      12345
      for(i=1;i<=5;i++)
      {
      for(j=1;j<=5;j++)
      printf("%d",j);
      printf("\n");
      }

      Delete
  6. what is logic of pattent

    1234321
    123 321
    12 21
    1 1

    ReplyDelete
    Replies
    1. void main()
      {
      int i,j,k;
      for(i=4;i>=1;i--)
      {
      for(j=1;j<=4;j++)
      {
      if(j<=i)
      printf("%d",j);
      else
      printf(" ");
      }
      for(j=3;j>=1;j--)
      {
      if(j<=i)
      printf("%d",j);
      else
      printf(" ");
      }
      printf("\n");
      }
      }

      Delete
    2. a million thanks

      Delete
  7. please help me out with this
    z y x w v w x y z
    z y x w x y z
    z y x y z
    z y z
    z

    ReplyDelete
    Replies
    1. void main()
      {
      int i,j;
      clrscr();
      for(i=5;i>=1;i--)
      {
      for(j=1;j<=i;j++)
      printf("%c ",123-j);
      for(j-=2;j>=1;j--)
      printf("%c ",123-j);
      printf("\n");
      }
      getch();
      }

      Delete
  8. How to print this pyramid

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

    ReplyDelete
    Replies
    1. this should work, not tested ...
      for(i=5;i>=1;i--)
      {
      for(j=5;j>i;j--)
      {
      printf(" ");
      }
      for(k=1;k<=i;k++)
      {
      printf("%d ",k);
      }
      printf("\n");
      }

      Delete
    2. it workd..i wantd fr * patrn.. thanx !

      Delete
    3. It works.. thank you

      Delete
  9. How to print this
    ABCDEFEDCBA
    ABCDE.EDCBA
    ABCD…..DCBA
    ABC……….CBA
    AB……………BA
    A……………...A
    plzz help!! Dots are spaces …

    ReplyDelete
    Replies
    1. void main()
      {
      int i,j,k;
      for(i=5;i>=1;i--)
      {
      for(j=1;j<=5;j++)
      {
      if(j<=i)
      printf("%c",'A' + j-1);
      else
      printf(" ");
      }
      for(j=4;j>=1;j--)
      {
      if(j<=i)
      printf("%c",'A' + j-1);
      else
      printf(" ");
      }
      printf("\n");
      }
      }

      Delete
  10. Replies
    1. int main()
      {
      int i, j;
      for(i=1;i<=4;i++)
      {
      printf("%d\n",i);
      for(j=1;j<=i;j++)
      {
      printf("%d",j);
      }
      printf("\n");
      }
      }

      Delete
  11. Replies
    1. void main()
      {
      int i, j;
      for(i=1;i<=5;i++)
      {
      for(j=1;j<=i;j++)
      {
      if(i%2==0)
      printf("%d",i/2);
      else
      printf("%c",'A' + i/2);
      }
      printf("\n");
      }
      }

      Delete
    2. Nimish your program works properly..

      Delete
  12. Pls help me.....

    54321
    _5432
    __543
    ___54
    ____5


    ____5
    ___45
    __345
    _2345
    12345

    _is space....

    ReplyDelete
    Replies
    1. 54321
      _5432
      __543
      ___54
      ____5

      main()
      {
      int i,j;
      for(i=5;i>=1;i--)
      {
      for(j=5;j>=1;j--)
      {
      if(j>i)
      printf(" ");
      else
      printf("%d",j);
      }
      printf("\n");
      }
      }

      Delete
    2. ____5
      ___45
      __345
      _2345
      12345

      main()
      {
      int i,j;
      for(i=5;i>=1;i--)
      {
      for(j=1;j<=5;j++)
      {
      if(j<i)
      printf(" ");
      else
      printf("%d",j);
      }
      printf("\n");
      }
      }

      Delete
  13. 54321
    *4321
    **321
    ***21
    ****1

    12345
    *2345
    **345
    ***45
    ****5

    ****5
    ***45
    **345
    *2345
    12345

    Pls help me with these programs pls...i need space where * is written.

    Thank you

    ReplyDelete
    Replies
    1. 54321
      *4321
      **321
      ***21
      ****1

      main()
      {
      int i,j;
      for(i=5;i>=1;i--)
      {
      for(j=5;j>=1;j--)
      {
      if(i<j)
      printf(" ");
      else
      printf("%d",j);
      }
      printf("\n");
      }
      }

      Delete
    2. 12345
      *2345
      **345
      ***45
      ****5

      main()
      {
      int i,j;
      for(i=1;i<=5;i++)
      {
      for(j=1;j<=5;j++)
      {
      if(j<i)
      printf(" ");
      else
      printf("%d",j);
      }
      printf("\n");
      }
      }

      Delete
    3. ****5
      ***45
      **345
      *2345
      12345

      main()
      {
      int i,j;
      for(i=5;i>=1;i--)
      {
      for(j=1;j<=5;j++)
      {
      if(j<i)
      printf(" ");
      else
      printf("%d",j);
      }
      printf("\n");
      }
      }

      Delete
  14. i want to print

    c
    co
    com
    comp
    compu
    comput
    compute
    computer

    please tell me the programme to write the above
    thankssssssss

    ReplyDelete
    Replies
    1. #include
      #include
      int main()
      {
      char s[]="computer";
      int i,j;
      for(i=0;s[i];i++)
      {
      for(j=0;j<=i;j++)
      printf("%c",s[j]);
      printf("\n");
      }
      return 0;
      }

      Delete
    2. sir plzz tellme this program using manipulators in c++

      Delete
  15. sir can you give me your phone no. or email ID so that i can contact you directly....

    ReplyDelete
  16. What is the code for ??
    1 2 3 4 4 3 2 1
    1 2 3 3 2 1
    1 2 2 1
    1 1

    ReplyDelete
    Replies
    1. void main()
      {
      int i,j,k;
      for(i=4;i>=1;i--)
      {
      for(j=1;j<=i;j++)
      {
      printf("%d",j);
      }
      for(j=i;j>=1;j--)
      {
      printf("%d",j);
      }
      printf("\n");
      }
      }

      Delete
  17. Replies
    1. printf("1\n");
      for(i=3;i<=4;i++)
      {
      for(j=2;j<=i;j++)
      printf("%d",j);
      for(j=i-1;j>=2;j--)
      printf("%d",j);
      printf("\n");
      }

      Delete
  18. what is program for this?
    *##
    #*#
    ##*
    help!

    ReplyDelete
    Replies
    1. for(i=1;i<=3;i++)
      {
      for(j=1;j<=3;j++)
      {
      if(i==j) printf("*");
      else printf("#");
      }
      printf("\n");
      }

      Delete
  19. how this can be code in c
    1*3*5*7
    2*4*6
    3*11
    8*10
    13
    pls help as soon as possible

    ReplyDelete
  20. Replies
    1. for(i=1;i<=5;i++)
      {
      for(j=1;j<=i;j++)
      {
      if(j%2==0) printf("A");
      else printf("*");
      }
      printf("\n");
      }

      Delete
  21. Please give the solutionof modular program to read n numbers and find divisors of each of them........

    ReplyDelete
  22. what is the programe
    1
    23
    456
    7890
    12345

    ReplyDelete
    Replies
    1. int main()
      {
      int i,j,k;
      k=1;
      for(i=1;i<=5;i++)
      {
      for(j=1;j<=i;j++)
      {
      if(k==10) k=0;
      printf("%d",k++);
      }
      printf("\n");
      }
      }

      Delete
  23. Replies
    1. tweak with http://cbasicprogram.blogspot.in/2012/04/number-pattern-20.html

      in inner loop replace
      printf("%d",j%2);

      with

      if (j%2==0)
      printf("2");
      else
      printf("1");

      Delete
  24. 1 2 3 4 5
    16 6
    15 7
    14 8
    13 12 11 10 9

    ReplyDelete
    Replies
    1. Tweak with this http://cbasicprogram.blogspot.in/2012/05/perfect-square.html

      Delete
  25. Replies
    1. http://cbasicprogram.blogspot.in/2012/04/number-pattern-1.html
      in above program just change printf("%d",j); to printf("%d",j*j);

      Delete
  26. how will we print this
    1234
    14 5
    13 6
    12 7
    111098

    ReplyDelete
    Replies
    1. tweak with http://cbasicprogram.blogspot.in/2012/05/perfect-square.html

      Delete
  27. 1 2 3
    4 5
    6 7 8 9
    10 11 12
    13 14
    15

    Help please!
    TIA!

    ReplyDelete
  28. will you please help me this
    1
    232
    23432
    2345432

    ReplyDelete
    Replies
    1. tweak with http://cbasicprogram.blogspot.in/2012/04/number-pattern-27.html

      Delete
  29. Thank you very much... :)
    u helped me a lot..

    ReplyDelete
  30. 55555
    55555
    45555
    34555
    23455
    12345

    how to make it? plzzzz teach me..... what im going to do is a rectangular, so there will be extra one lane compare to it's base...

    ReplyDelete
    Replies
    1. http://cbasicprogram.blogspot.in/2012/04/number-pattern-18.html
      Print extra line before the loop, or start loop with 6 and if i=6 then print i else rest of the logic

      Delete
  31. 5 5 5 5 5
    5 5
    5 5
    5 5
    5 5 5 5 5
    code for this plz.............

    ReplyDelete
    Replies
    1. use http://cbasicprogram.blogspot.in/2013/01/number-pattern-42.html
      and print 5 instead of 1

      Delete
  32. 1
    3 5
    7 9 11
    13 15 17 19
    21 23 25 27 29

    ReplyDelete
    Replies
    1. http://cbasicprogram.blogspot.in/2012/04/number-pattern-19.html
      just modify it to increment k by 2 instead of 1

      Delete
  33. Replies
    1. http://cbasicprogram.blogspot.in/2012/04/number-pattern-1.html
      change from printf("%d",j);
      to printf("%d",(j*2)-1);

      Delete
  34. plz help me in this

    *****1
    ****12
    ***123
    **1234
    *12345
    123456

    ReplyDelete
    Replies
    1. Just add following loop as first inner loop
      http://cbasicprogram.blogspot.in/2012/04/number-pattern-1.html
      for(j=4;j>=i;j--)
      {
      printf("*");
      }

      Delete
  35. 5
    15 5
    25 15 5
    35 25 15 5


    help me plz

    ReplyDelete
    Replies
    1. http://cbasicprogram.blogspot.in/2012/04/number-pattern-3.html
      just modify printf("%d",j);
      to printf("%d ",(j*10)-5);

      Delete
  36. Its very helpful for me Thanks :)

    ReplyDelete
  37. @nimish
    dude you are awesome ....so helpful blog !!
    keep updating...tc

    ReplyDelete
  38. please write here the solution :

    1
    2 5
    6 9 14
    15 18 23 30
    31 34 39 46 57

    ReplyDelete
    Replies
    1. hit for rows
      1 + 1x1 = 2
      2 + 2x2 = 6
      6 + 3x3 = 15
      15 + 4x4 = 31
      31 + 5x5 = 56

      for columns
      add 3,5,7,9...

      Delete
  39. thanks,this program is very helpful for me.....!!!!!!!

    ReplyDelete
  40. _ _ 1
    _ 2
    3 _ _
    _ 4 _
    _ _ 5

    Sir, Could you Please reply for This Pattern. It would be very helpful sir
    Thank u

    ReplyDelete
    Replies
    1. for(i=1;i<=5;i++)
      {
      for(j=1;j<=3-i;j++)
      printf(" ");
      for(j=4;j<=i;j++)
      printf(" ");
      printf("%d\n",i);
      }

      Delete
  41. please write here the solution :
    1
    3 2
    4 5 6
    10 9 8 7
    11 12 13 14

    ReplyDelete
    Replies
    1. http://cbasicprogram.blogspot.in/2013/01/number-pattern-52.html

      Delete
  42. plss i need this to be done.. wap to generate the foll pattern:
    1
    232
    34543
    4567654
    567898765

    ReplyDelete
    Replies
    1. http://cbasicprogram.blogspot.in/2013/01/number-pattern-53.html

      Delete
  43. plz give the coding of this in c++

    11
    1212
    123123
    12341234

    ReplyDelete
    Replies
    1. simply use inner J loop 2 times of http://cbasicprogram.blogspot.in/2012/04/number-pattern-1.html

      Delete
  44. How to find the sum of following series:-

    (1) + (1+2) + (1+2+3) + (1+2+3+4)....... upto n number of terms

    ReplyDelete
    Replies
    1. http://cbasicprogram.blogspot.in/2013/01/series-program.html

      Delete
  45. How to find the following sum:-

    1/2 - 2/3 + 3/4 -4/5 + 5/6...... upto n number of terms

    ReplyDelete
    Replies
    1. http://cbasicprogram.blogspot.in/2013/01/series-program-9.html

      for Series programs please put your comments on Series Programs Page
      http://cbasicprogram.blogspot.in/2013/01/series-program.html

      Delete
  46. it is very useful for me thanks a lot!!!!!

    ReplyDelete
  47. _ _ _ _ 1_ _ _ _
    _ _ _ 1 2 1_ _ _
    _ _ 1 2 3 2 1_ _
    _ 1 2 3 4 3 2 1_
    1 2 3 4 5 4 3 2 1

    What would be the code for this pattern?
    (Ignore '_'. Used for indenting)

    ReplyDelete
    Replies
    1. http://cbasicprogram.blogspot.in/2013/01/number-pattern-56.html

      Delete
  48. Please give code for:
    ___________1
    ________2_____2
    _____3___________3
    _ 4__________________4
    _____3___________3
    ________2_____2
    ___________1

    ReplyDelete
    Replies
    1. http://cbasicprogram.blogspot.in/2013/01/number-pattern-57.html

      Delete
  49. 1 2 3 4 5
    16 6
    15 7
    14 8
    13 12 11 10 9


    Please tell me how to print above pattern?

    ReplyDelete
    Replies
    1. http://cbasicprogram.blogspot.com/2013/01/number-pattern-58.html

      Delete
  50. WAP to get the sum of series 1+2 pow x+3 pow x+.......+n pow x

    ReplyDelete
  51. Sir Plz upload Linked list concepts and Programs

    ReplyDelete
  52. series of numbers entered by user the program is to check weather the the user entered in series or not

    ReplyDelete
  53. can anyone tell me the code to print the following structure

    1
    3 5
    7 9 11

    ReplyDelete
  54. 1,2,3,6,9,18,27,54 how to print this series

    ReplyDelete
    Replies
    1. http://cbasicprogram.blogspot.com/2013/01/series-program-10.html

      Delete
  55. thnxxx a lot @nimish sir.....its very helpful for me....keep updating sir..and give me your email id for contact ... thnkuuu so much

    ReplyDelete
  56. program for:
    1
    1 1
    1 2 1
    1 3 3 1
    1 4 6 4 1

    ReplyDelete
    Replies
    1. http://cbasicprogram.blogspot.in/2013/01/pascal-triangle.html

      Delete
  57. how to display the pattern with a number
    eg:- N=39714

    3 9 1 7 4
    9 1 7 4
    1 7 4
    7 4
    4

    ReplyDelete
  58. This web blogspot is best among all I have ever seen you are doing good job nimish bro I got cleared many doutsdouts thanks.

    ReplyDelete
  59. thanks a lot for this logics . its asome blog for beginers of C

    ReplyDelete
  60. This is one of the vast collections of pattern programming in C!
    Thanks for your work!

    ReplyDelete
  61. thanks a lot for logics ....this blog is very helpful

    ReplyDelete
  62. thank you for the information, this is very useful

    ReplyDelete
  63. WAP to calculate the sum of a given no. 123=1 2 3=6.. Help me in solving this program

    ReplyDelete
  64. Hey you are doing great job .! kudos to you .
    can I have your Email id so that i can resolve my stuff on mail

    ReplyDelete
  65. Really helpful...thank you so much.....

    ReplyDelete
  66. is there is any simple logic for pattern programs

    ReplyDelete
  67. Hi Sir I Want To Learning Functions OOP In C++ ;

    ReplyDelete
  68. how have you developed good coding skills? can you reply?

    ReplyDelete
    Replies
    1. Practice and Practice and more practice :)

      Delete
  69. Sir can u tell me how to understand a number pattern program

    ReplyDelete