// API callback
relpostimgcuplik({"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$blogger":"http://schemas.google.com/blogger/2008","xmlns$georss":"http://www.georss.org/georss","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$thr":"http://purl.org/syndication/thread/1.0","id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268"},"updated":{"$t":"2023-07-30T02:11:08.392-07:00"},"category":[{"term":"C Programs"},{"term":"Learn C"},{"term":"Common Programming Error"},{"term":"searching and sorting"},{"term":"control sturctures"},{"term":"Fundamental"},{"term":"List of C Programs"},{"term":"string"},{"term":"Array"},{"term":"Pattern"},{"term":"Contents"},{"term":"Pointers"},{"term":"functions"},{"term":"Dynamic memory allcation"},{"term":"recursion"},{"term":"C Turbo Compiler"},{"term":"File Handling"},{"term":"Structures"}],"title":{"type":"text","$t":"C Programming Tutorial"},"subtitle":{"type":"html","$t":"It is a blog about c programming. Here we provide c programs and tutorials to enhance your skills."},"link":[{"rel":"http://schemas.google.com/g/2005#feed","type":"application/atom+xml","href":"https:\/\/www.comp-psyche.com\/feeds\/posts\/default"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/-\/Pattern?alt=json-in-script\u0026max-results=50"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/search\/label\/Pattern"},{"rel":"hub","href":"http://pubsubhubbub.appspot.com/"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"generator":{"version":"7.00","uri":"http://www.blogger.com","$t":"Blogger"},"openSearch$totalResults":{"$t":"4"},"openSearch$startIndex":{"$t":"1"},"openSearch$itemsPerPage":{"$t":"50"},"entry":[{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-4120851131041148268"},"published":{"$t":"2014-02-02T03:06:00.000-08:00"},"updated":{"$t":"2014-07-15T20:46:52.038-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"C Programs"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Pattern"}],"title":{"type":"text","$t":"C PROGRAM : PATTERN"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Ctitle\u003EC PROGRAMS : PATTERN\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns3.html#p16\" name=\"p16\"\u003E16. Program to print the given pattern \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Program to print the given Pattern\n\n\/*\n\n1  \n2 6 \n3 7 10\n4 8 11 13\n5 9 12 14 15 ... till n rows\n\n*\/\n\n\/* \n\nFor example :\n\nFor n=3\n\n1\n2 4\n3 5 6\n\nFor n=6\n\n1  \n2 7 \n3 8 12\n4 9 13 16 \n5 10 14 17 19\n6 11 15 18 20 21\n\n*\/\n\n#include \u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n int main()\n  { \n  \/\/ Declaring variable i, j to iterate loop\n int i, j;    \n \n \/\/ Declaring variable n = maximum rows \n int n;\n \n \/\/Declaring variable k and num to help in generating \"values\"\n int k, num=1; \n \n \/\/ Inputting Number of rows\n printf(\"Enter number of rows : \");\n  scanf(\"%d\",\u0026amp;n);\n \n  \/\/ Running loop for rows\n  for (i=1; i\u0026lt;=n ; i++) \n  {\n     num=i;\n     k=n-1;\n  \n   \/\/ printing values\n  for (j=1; j\u0026lt;=i; j++) \n      {\n       \/\/ %-4d = reserves 4 spaces for printing \"value\" to obtain clarity in pattern\n printf(\"%-4d\",num);\n        num=num+k;\n        k=k-1;    \n      } \n      \n   printf(\"\\n\");    \n }\n        \n     getch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n     return 0; \n  }\u003C\/span\u003E \n\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns3.html#p17\" name=\"p17\"\u003E17. Program to print the given pattern \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Program to print pattern : Hollow Diamond\n\n\/* \n\n******** ********\n*******   *******\n******     ****** \n*****       *****\n****         ****\n***           ***\n**             **\n*               *\n\n*               *\n**             **\n***           ***\n****         ****\n*****       ***** \n******     ******\n*******   *******\n******** ********\n\nLOGIC :\n\nBREAKING IT UP : It has 2 parts\n\nFirst part :\n\n******** ********\n*******   *******\n******     ****** \n*****       *****\n****         ****\n***           ***\n**             **\n*               *\n\nWhich is further divided into : \n\nFirst Sub Part :\n\n********\n*******\n******\n*****\n****\n***\n**\n* \n\nSecond Sub part :\n\n******** \n ******* \n  ****** \n   *****  \n    ****             \n     ***               \n      **\n       *\n       \nAnd ofcourse the spaces before it.\n\nSecond Part :\n\n*               *\n**             **\n***           ***\n****         ****\n*****       ***** \n******     ******\n*******   *******\n******** ********\n\nWhich is further divided into :\n\nFirst Sub Part :\n\n*       \n**      \n***     \n****    \n*****   \n******  \n******* \n********\n\nSecond Sub Part :\n\n       *       \n      **      \n     ***     \n    ****    \n   *****   \n  ******  \n ******* \n******** \n\nAnd the spaces before it.\n\n*\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\nint main()\n{\n \/\/ Declaring variable i, j, s to iterate loop \n int i, j, s;\n \n \/\/ Declaring ms = maximum space\n int ms = 1;\n \n \/\/ Running loop for rows for first part\n for(i=1;i\u0026lt;=8;i++)\n {\n  \/\/ Printing first Sub Part :\n  for(j=8;j\u0026gt;=i;j--)\n  {\n   printf(\"*\");\n  }\n  \n  \/\/ Printing spaces\n  for(s=1;s\u0026lt;=ms;s++)\n  {\n   printf(\" \");\n  }\n  \/\/ Incresing spaces\n  ms=ms+2;\n  \n  \/\/ Printing Second Sub Part :\n  for(j=8;j\u0026gt;=i;j--)\n  {\n   printf(\"*\");\n  }\n  \n  printf(\"\\n\");\n  \n }\n \n printf(\"\\n\");\n \/\/ Initialising ms = 15 i.e the maximum space\n ms = 15;\n \n\/\/ Running loop for Second Part\n for(i=1;i\u0026lt;=8;i++)\n {\n  \/\/ Printing first Sub Part :\n  for(j=1;j\u0026lt;=i;j++)\n  {\n   printf(\"*\");\n  }\n  \n  \/\/ Printing spaces\n  for(s=1;s\u0026lt;=ms;s++)\n  {\n   printf(\" \");\n  }\n  \/\/ Reducing spaces\n  ms=ms-2;\n  \n  \/\/ Printing Second Sub Part :\n  for(j=1;j\u0026lt;=i;j++)\n  {\n   printf(\"*\");\n  }\n  \n  printf(\"\\n\");\n  \n }\n\n    getch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n    return 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns3.html#p18\" name=\"p18\"\u003E18. Program to print the given pattern \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/*\n\n      *\n     ***\n    *****\n   *******\n  *********\n   *******  \n    *****\n     ***\n      * \n\nBREAKING IT UP : The above pattern has two parts\n\nFirst Part :\n\n      *\n     ***\n    *****\n   *******\n  *********\n\nSecond Part :\n\n   *******  \n    *****\n     ***\n      * \n\n *\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\nint main()\n{\n \/\/ Declaring variable i, j, s to iterate loop\n    int i,j,s;\n    \n    \/\/ Declaring variable ms = maximum space\n    int ms = 5;\n    \n    \/\/ Declaring variable to print \"*\" ( asterik )\n    int as = 1;\n    \n    \/\/ Running loop for First part\n    for(i=1;i\u0026lt;=5;i++)\n    {\n     \/\/ Printing Space\n     for(s=1;s\u0026lt;=ms;s++)\n     {\n      printf(\" \");\n     }\n     \n     \/\/ Reducing spaces\n     ms--;\n     \n     \/\/ Printing First Part\n     for(j=1;j\u0026lt;=as;j++)\n     {\n      printf(\"*\");\n     }\n     \n     \/\/ Increasing Asterik ( \"*\" )\n     as=as+2;\n     \n     printf(\"\\n\");\n    }\n    \n \/\/ Re-initialising ms = maximum space and aterik\n ms=2;\n as=7;\n \n    \/\/ Running loop for Second Part\n     for(i=1;i\u0026lt;=5;i++)\n    {\n     \/\/ Printing Space\n     for(s=1;s\u0026lt;=ms;s++)\n     {\n      printf(\" \");\n     }\n     \n     \/\/ Increasing spaces\n     ms++;\n     \n     \/\/ Printing First Part\n     for(j=1;j\u0026lt;=as;j++)\n     {\n      printf(\"*\");\n     }\n     \n     \/\/ Decreasing Asterik ( \"*\" )\n     as=as-2;\n     \n     printf(\"\\n\");\n    }\n    \ngetch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\nreturn 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns3.html#p19\" name=\"p19\"\u003E19. Program to print the given pattern \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/*\n\n8 4 2 1\n4 2 1\n2 1\n1\n\n *\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt;\nint main()\n{\n int n=8,m;\n int i,j;\n m=n;\n \n for(i=4;i\u0026gt;=1;i--)\n {\n  for(j=1;j\u0026lt;=i;j++)\n  {\n   printf(\"%d \",m);\n   m=m\/2; \n  }\n  m=n\/2;\n  n=n\/2;\n  printf(\"\\n\");\n }\n \n getch();\n return 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns3.html#p20\" name=\"p20\"\u003E20. Program to print the given pattern \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\nint main()\n{\n        int arr[30],temp[30],i,j,k,l,n;\n     \n       printf(\"Enter the number of lines to be printed: \");\n       scanf(\"%d\",\u0026amp;n);\n\n       temp[0]=1;\n       arr[0]=1;\n\n       for(j=0;j\u0026lt;n;j++)\n       printf(\" \");\n\n       printf(\" 1\\n\");\n\n       for(i=1;i\u0026lt;n;i++)\n       {\n               for(j=0;j\u0026lt;n-i;j++)\n       printf(\" \");\n\n       for(k=1;k\u0026lt;i;k++)\n       {\n                  arr[k]=temp[k-1]+temp[k];      \n        }\n\n                arr[i]=1;\n\n                for(l=0;l\u0026lt;=i;l++)\n       {\n                 printf(\"%2d\",arr[l]);\n                 temp[l]=arr[l];\n        }\n\n\n                printf(\"\\n\");\n        }\n\ngetch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\nreturn 0;\n\n}\n\u003C\/span\u003E\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"color: yellow;\"\u003EMore Informative posts :\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns.html\"\u003EC Programs Pattern ( 1-5 )\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns1.html\"\u003EC Programs Pattern ( 6-10 )\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-pointers2.html\"\u003EC Programs Pattern ( 11-16 )\u003C\/a\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003C\/div\u003E\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comp-psyche.com\/feeds\/4120851131041148268\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns3.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/4120851131041148268"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/4120851131041148268"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns3.html","title":"C PROGRAM : PATTERN"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-567350625665758846"},"published":{"$t":"2014-02-02T02:54:00.000-08:00"},"updated":{"$t":"2014-07-15T20:47:05.108-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"C Programs"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Pattern"}],"title":{"type":"text","$t":"C PROGRAM : PATTERN"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Ctitle\u003EC PROGRAMS : PATTERN\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-pointers2.html#p11\" name=\"p11\"\u003E11. Program to print the given pattern\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Program to print the given patter :\n\n\/* \n        5\n      4 5\n    3 4 5\n  2 3 4 5\n1 2 3 4 5\n\n\n*\/\n\n\/* \n\nREMEMBER : We always design logic according to the pattern.\n\nLOGIC:\n\nSimplifying the pattern :\n\n--------5\n------4 5\n----3 4 5 \n--2 3 4 5\n1 2 3 4 5\n\nHere ( - ) indicates space before \"value\" to be printed.\ni.e -- indicates two space, ---- indicates four space and so on.\n\nThe above patter is similar to patern:\n5\n4 5\n3 4 5 \n2 3 4 5\n1 2 3 4 5\n\nThe only difference is we print spaces before the \"values\". \nSo design logic according to this and print spaces before that.\nIts as simple as you like.\n\nConsider the diagonal to be rows and a single line to be column.\n\nNow earlier we worked only on rows and columns without spaces before the printed \"value\" \nbut now we have spcaes as well.\nSo we include another loop for spaces.\n\nNumber of loops required = 3 \n( since we have rows and columns and also spaces. 1 loop for row and 1 loop for column \nand 1 loop for spaces.)\n\nIt would be a nested loop since Number of columns depends on Number of rows.\n\nOuter loop will be for rows and inner loop will be for columns. \nOne more inner loop will be for printing space.\n\nAbove pattern is different from the pattern we have been printing.\nNotice the diagonal values are all same ( i.e 5 - neither increasing nor decreasing ) and\nAlso the initial column value is changing. So what do we do????\n\nSimple, Since diagonal values are all same ( i.e 5 - neither increasing nor decreasing ) \nso we consider ( 5 4 3 2 1 ) as diagonal values.\nSo, we run \"i\" loop i.e the outer loop from 5 to 1 \nas the diagonal values are in decreasing order according to our assumption.\n\nAlso if you notice the single line value( i.e column value ) is in increasing order \nthe only catch is this time the initial \"value\" is changing and the last \"value\" is fixed. \nEarlier it was just the reverse of it.\nSo, now we run \"j\" loop i.e the inner loop from \"i\" to 5 as last value is always 5.\n\nNow For spaces : If you notice the spaces are in decreasing manner \n( i.e 8 spaces, 6 spaces, 4 spaces, 2 spaces and then none )\nWe can print the spaces by utilising \"i\" value \nbut to simplify the pattern and make it easier we use another value m=8 and \nreduce it by 2 after the completion of loop for spaces.\ni.e We run the inner loop \"s\" from 1 to m.\n\nWe print \"value\" in the inner loop \nsince number of columns = number of \"value\" to be printed.\nNOTE : WE CAN PRINT ANYTHING WHICH WE WANT. ( for ex : printf(\"%d\",j) or printf(\"%d\",i) or anything according to pattern.\n\nLastly after one rotation (completion) of inner loop we need to go to the next line so we use printf(\"\\n\") statement after closing the \ninner loop and before closing the outer loop.\n\nComments are given to make you understand the program..\n\n*\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\nint main()\n{\n\/\/ Declaring variable i, j, s to iterate outer and inner loop respectively\n\/\/ we are using \"i\" for rows, \"j\" for columns ans \"s\" for spaces.\nint i, j, s;\n \n\/\/ Initialising m = 8 as maximum number of space = 8\nint m = 8;\n \n\/* Since we have five rows so we iterate the \"i\" loop from 5 to 1 ( i.e 5 times )\nWe run the \"i\" loop in decreasing order ( i.e from 5 to 1 ) \nsince rows is in increasing order(5 4 3 2 1 diagnol value - according to our assumption of diagonal values ) *\/\nfor(i=5;i\u0026gt;=1;i--)\n{\n\/\/ Printing spaces\nfor(s=1;s\u0026lt;=m;s++)\n{\nprintf(\" \");\n}\n\/\/ Reducing value of \"m\" by 2 to reduce spaces\nm=m-2;\n  \n\/* Notice in above pattern Number of columns = Position of rows \n( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\nwe run the \"j\" loop in increasing order ( i.e from i to 5 ) since column is in increasing order. *\/\n  \nfor(j=i;j\u0026lt;=5;j++)\n{\n\/\/ Printing \"value\" in the inner loop since number of columns = number of \"value\" to be printed.\n\/* Here we print the value of \"j\" since value to be printed is the position of the column according to initialisation in loop. *\/\n\nprintf(\"%d \",j);\n}\n  \n\/\/ After completion of printing \"value\" in row we need to go to the next row.\nprintf(\"\\n\");\n}\n \ngetch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\nreturn 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-pointers2.html#p12\" name=\"p12\"\u003E12. Program to print the given pattern\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ NOTE : For Better understanding read both LOGIC and COMMENTS\n\n\/\/ Program to print the given patter :\n\n\/* \n\n1\n* *\n1 2 3\n* * * *\n1 2 3 4 5 .... till n rows\n\nHere n = any integer value entered by user.\n  n represents rows.\n\nExample :\n\nFor n=2\n\n1\n* *\n\nFor n=6\n\n1\n* *\n1 2 3\n* * * *\n1 2 3 4 5 \n* * * * * *\n\n*\/\n\n\/* \n\nREMEMBER : We always design logic according to the pattern.\n\nLOGIC:\n\nIn above Pattern Number of rows = n\n\nConsider the diagonal to be rows and a single line to be column.\n\nNumber of loops required = 2 \n( since we have rows and columns. 1 loop for row and 1 loop for column. )\n\nIt would be a nested loop since Number of columns depends on Number of rows.\n\nOuter loop will be for rows and inner loop will be for columns.\nouter loop \"i\" runs from 1 to n since we have n rows.\nWe run the \"i\" loop in increasing order ( i.e from 1 to n )\nsince rows is in increasing order(1 3  5 ... n diagnol value)\n\nNotice in above pattern Number of columns = Position of rows \n( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\nso we run the \"j\" loop i.e the inner loop from 1 to \"i\".\nWe run the \"j\" loop in increasing order ( i.e from 1 to i ) \nsince column is in increasing order ( 1 2 3 ... i single line value )\n\nNow every time row%2 == 0 we print \"*\" instead of the regular values.\n\nWe print \"value\" in the inner loop \nsince number of columns = number of \"values\" to be printed.\nNOTE : WE CAN PRINT ANYTHING WHICH WE WANT. ( for ex : printf(\"%d\",j) or printf(\"%d\",i) or anything according to pattern.\n\nLastly after one rotation (completion) of inner loop we need to go to the next line so we use printf(\"\\n\") statement after closing the \ninner loop and before closing the outer loop.\n\nComments are given to make you understand the program..\n\n*\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\nint main()\n{\n\/\/ Declaring variable i,j to iterate outer and inner loop respectively\n\/\/ we are using \"i\" for rows and \"j\" for columns\nint i,j;\n \n\/\/Declaring Variale n=rows\nint n;\n \n\/\/ Entering number of rows from user\nprintf(\"Enter number of rows : \");\nscanf(\"%d\",\u0026amp;n);\n \n\/\/ Since we have five rows so we iterate the \"i\" loop from 1 to 5 ( i.e 5 times )\nfor(i=1;i\u0026lt;=n;i++)\n{\n\/* Notice in above pattern Number of columns = Position of rows \n( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\nso we run the \"j\" loop from 1 to \"i\" *\/\n   \nfor(j=1;j\u0026lt;=i;j++)\n{\n\/* Printing \"value\" in the inner loop \nsince number of columns = number of \"value\" to be printed. *\/\n  \nif(i%2==0)\nprintf(\"* \");\nelse\nprintf(\"%d \",j);\n}\n  \n\/\/ After completion of printing \"value\" in row we need to go to the next row. \nprintf(\"\\n\");\n}\n \ngetch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\nreturn 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-pointers2.html#p13\" name=\"p13\"\u003E13. Program to print the given pattern\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Program to print the given patter :\n\n\/* \n\n1                 1\n1 2             1 2\n1 2 3         1 2 3\n1 2 3 4     1 2 3 4\n1 2 3 4 5 1 2 3 4 5\n\n\n*\/\n\n\/* \n\nREMEMBER : We always design logic according to the pattern.\n\nLOGIC:\n\nSimplifying the pattern :\n\nWe break the pattern in parts : In this case in three parts.\n\nFirst part :\n1\n1 2\n1 2 3\n1 2 3 4 \n1 2 3 4 5\n\nSecond part : It is actually the spaces that we print before the third part.\n----------------\n  ------------\n    --------\n      ----  \n      \nHere ( - ) indicates space before \"value\" to be printed.\ni.e -- indicates two space, ---- indicates four space and so on.\n\nThird part :\n        1\n      1 2\n    1 2 3\n  1 2 3 4\n1 2 3 4 5\n\nThe above patter ( i.e the third part ) is similar to patern:\n1\n1 2\n1 2 3\n1 2 3 4\n1 2 3 4 5\n\nThe only difference is we print spaces before the \"values\". \nSo design logic according to this and print spaces before that.\nI am referring to the second part spaces. Its as simple as you like.\n\nIn earlier example I have explained enough so from now on I will not go in details.\n\nNumber of loops required = 4, one outer loop and the three inner loop.\n\nComments are given to make you understand the program..\n\n*\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\nint main()\n{\n \/* Declaring variable i, j, k, s \n to iterate outer and the three inner loop respectively *\/\n int i, j, k, s;\n \n \/\/ Initialising ms = 16 as maximum number of space = 16\n int ms = 16;\n \n \/\/ Running loop for rows\n for(i=1;i\u0026lt;=5;i++)\n {\n  \n  \/\/ Printing the First part : \n  for(j=1;j\u0026lt;=i;j++)\n  {\n   printf(\"%d \",j);\n  }\n  \n  \/\/ Printing spaces\n  for(s=1;s\u0026lt;=ms;s++)\n  {\n   printf(\" \");\n  }\n  \/\/ Reducing value of \"m\" by 4 to reduce spaces\n  ms=ms-4;\n  \n  \/\/ Printing the third part :\n  for(k=1;k\u0026lt;=i;k++)\n  {\n   printf(\"%d \",k);\n  }\n  \n  \/* After completion of printing \"value\" in row \n  we need to go to the next row.*\/\n  printf(\"\\n\");\n }\n \n getch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n return 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-pointers2.html#p14\" name=\"p14\"\u003E14. Program to print the given pattern\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Program to print the given patter :\n\n\/* \n\n1                 1\n1 2             2 1\n1 2 3         3 2 1\n1 2 3 4     4 3 2 1\n1 2 3 4 5 5 4 3 2 1\n\n\n*\/\n\n\/* \n\nREMEMBER : We always design logic according to the pattern.\n\nLOGIC:\n\nSimplifying the pattern :\n\nWe break the pattern in parts : In this case in three parts.\n\nFirst part :\n1\n1 2\n1 2 3\n1 2 3 4 \n1 2 3 4 5\n\nSecond part : It is actually the spaces that we print before the third part.\n----------------\n  ------------\n    --------\n      ----  \n      \nHere ( - ) indicates space before \"value\" to be printed.\ni.e -- indicates two space, ---- indicates four space and so on.\n\nThird part :\n        1\n      2 1\n    3 2 1\n  4 3 2 1\n5 4 3 2 1\n\nThe above patter ( i.e the third part ) is similar to patern:\n1\n2 1\n3 2 1\n4 3 2 1\n5 4 3 2 1\n\nThe only difference is we print spaces before the \"values\". \nSo design logic according to this and print spaces before that.\nI am referring to the second part spaces. Its as simple as you like.\n\nIn earlier example I have explained enough so from now on I will not go in details.\n\nNumber of loops required = 4, one outer loop and the three inner loop.\n\nComments are given to make you understand the program..\n\n*\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\nint main()\n{\n \/* Declaring variable i, j, k, s \n to iterate outer and thre three inner loop respectively *\/\n int i, j, k, s;\n \n \/\/ Initialising ms = 16 as maximum number of space = 16\n int ms = 16;\n \n \/\/ Running loop for rows\n for(i=1;i\u0026lt;=5;i++)\n {\n  \n  \/\/ Printing the First part : \n  for(j=1;j\u0026lt;=i;j++)\n  {\n    printf(\"%d \",j);\n  }\n  \n  \/\/ Printing spaces\n  for(s=1;s\u0026lt;=ms;s++)\n  {\n   printf(\" \");\n  }\n  \/\/ Reducing value of \"m\" by 4 to reduce spaces\n  ms=ms-4;\n  \n  \/\/ Printing the third part :\n  for(k=i;k\u0026gt;=1;k--)\n  {\n   printf(\"%d \",k);\n  }\n  \n  \/* After completion of printing \"value\" in row \n  we need to go to the next row. *\/\n  printf(\"\\n\");\n }\n \n getch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n return 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-pointers2.html#p15\" name=\"p15\"\u003E15. Program to print the given pattern\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Program to print the given patter :\n\n\/* \n\n1                 5\n1 2             5 4\n1 2 3         5 4 3\n1 2 3 4     5 4 3 2\n1 2 3 4 5 5 4 3 2 1\n\n\n*\/\n\n\/* \n\nREMEMBER : We always design logic according to the pattern.\n\nLOGIC:\n\nSimplifying the pattern :\n\nWe break the pattern in parts : In this case in three parts.\n\nFirst part :\n1\n1 2\n1 2 3\n1 2 3 4 \n1 2 3 4 5\n\nSecond part : It is actually the spaces that we print before the third part.\n----------------\n  ------------\n    --------\n      ----  \n      \nHere ( - ) indicates space before \"value\" to be printed.\ni.e -- indicates two space, ---- indicates four space and so on.\n\nThird part :\n        5\n      5 4\n    5 4 3\n  5 4 3 2\n5 4 3 2 1\n\nThe above patter ( i.e the third part ) is similar to patern:\n5\n5 4\n5 4 3\n5 4 3 2\n5 4 3 2 1\n\nThe only difference is we print spaces before the \"values\". \nSo design logic according to this and print spaces before that.\nI am referring to the second part spaces. Its as simple as you like.\n\nIn earlier example I have explained enough so from now on I will not go in details.\n\nNumber of loops required = 4, one outer loop and the three inner loop.\n\nComments are given to make you understand the program..\n\n*\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\nint main()\n{\n \/* Declaring variable i, j, k, s \n to iterate outer and thre three inner loop respectively *\/\n int i, j, k, s;\n \n \/\/ Initialising ms = 16 as maximum number of space = 16\n int ms = 16;\n \n \/\/ Initialising variable to help print third part tp = 5\n int tp = 5;\n \n \/\/ Running loop for rows\n for(i=1;i\u0026lt;=5;i++)\n {\n  \n  \/\/ Printing the First part : \n  for(j=1;j\u0026lt;=i;j++)\n  {\n    printf(\"%d \",j);\n  }\n  \n  \/\/ Printing spaces\n  for(s=1;s\u0026lt;=ms;s++)\n  {\n   printf(\" \");\n  }\n  \/\/ Reducing value of \"m\" by 4 to reduce spaces\n  ms=ms-4;\n  \n  \/\/ Printing the third part :\n  for(k=5;k\u0026gt;=tp;k--)\n  {\n   printf(\"%d \",k);\n  }\n  \/\/Reducing value of tp = variable used to print third part\n  tp--;\n  \n  \/* After completion of printing \"value\" in row \n  we need to go to the next row. *\/\n  printf(\"\\n\");\n }\n \n getch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n return 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"color: yellow;\"\u003EMore Informative posts :\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns.html\"\u003EC Programs Pattern ( 1-5 )\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns1.html\"\u003EC Programs Pattern ( 6-10 )\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns3.html\"\u003EC Programs Pattern ( 16-20 )\u003C\/a\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003C\/div\u003E\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comp-psyche.com\/feeds\/567350625665758846\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2014\/02\/c-programs-pointers2.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/567350625665758846"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/567350625665758846"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2014\/02\/c-programs-pointers2.html","title":"C PROGRAM : PATTERN"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-5719397974851199886"},"published":{"$t":"2014-02-01T23:34:00.002-08:00"},"updated":{"$t":"2014-07-15T20:47:10.249-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"C Programs"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Pattern"}],"title":{"type":"text","$t":"C PROGRAMS : PATTERN"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Ctitle\u003EC PROGRAMS : PATTERN\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns1.html#p6\" name=\"p6\"\u003E6. Program to print the given pattern\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cspan style=\"color: blue;\"\u003E\/\/ Program to print the given patter :\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003E\/*\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003E5\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E5 4\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E5 4 3\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E5 4 3 2\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E5 4 3 2 1\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003E*\/\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003E\/*\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003EREMEMBER : We always design logic according to the pattern.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003ELOGIC:\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003EConsider the diagonal to be rows and a single line to be column.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003ENumber of loops required = 2\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E( since we have rows and columns. 1 loop for row and 1 loop for column. )\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003EIt would be a nested loop since Number of columns depends on Number of rows.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003EOuter loop will be for rows and inner loop will be for columns.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003Eouter loop \"i\" runs from 5 to 1 since we have 5 rows.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003EWe run the \"i\" loop in decreasing order ( i.e from 5 to 1 )\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Esince rows is in increasing order(5 4 3 ... 1 diagnol value)\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003ENotice in above pattern Number of columns = Position of rows\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Eso we run the \"j\" loop i.e the inner loop from 5 to i.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003EWe run the \"j\" loop in decreasing order ( i.e from 5 to i )\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Esince column is in decreasing order ( 5 4 ... i single line value )\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003EWe print \"value\" in the inner loop\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Esince number of columns = number of \"value\" to be printed.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003ENOTE : WE CAN PRINT ANYTHING WHICH WE WANT. ( for ex : printf(\"%d\",j) or printf(\"%d\",i) or anything according to pattern.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003ELastly after one rotation (completion) of inner loop we need to go to the next line so we use printf(\"\\n\") statement after closing the\u0026nbsp;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Einner loop and before closing the outer loop.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003EComments are given to make you understand the program..\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003E*\/\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;stdio.h\u0026gt;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;conio.h\u0026gt;\u0026nbsp;\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003Eint main()\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\/\/ Declaring variable i,j to iterate outer and inner loop respectively\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\/\/ we are using \"i\" for rows and \"j\" for columns\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Eint i,j;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003E\/* Since we have five rows but now we should also keep an eye on the pattern to be printed.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003E\u0026nbsp;Since the pattern to be printed is in descending order so we iterate the \"i\" loop from 5 to 1 ( i.e 5 times ) *\/\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Efor(i=5;i\u0026gt;=1;i--)\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\/* Notice in above pattern Number of columns = Position of rows ( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Eso we run the \"j\" loop i.e the inner loop from 5 to i. *\/\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003Efor(j=5;j\u0026gt;=i;j--)\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\/* Here we print the value of \"j\" since value to be printed is the position of the column according to initialisation in loop. *\/\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cbr \/\u003E\n\u003C\/span\u003E \u003Cspan style=\"color: blue;\"\u003Eprintf(\"%d \",j);\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E}\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan class=\"Apple-tab-span\" style=\"white-space: pre;\"\u003E\u003Cspan style=\"color: blue;\"\u003E  \u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\/\/ After completion of printing \"value\" in row we need to go to the next row.\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Eprintf(\"\\n\");\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E}\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan class=\"Apple-tab-span\" style=\"white-space: pre;\"\u003E\u003Cspan style=\"color: blue;\"\u003E \u003C\/span\u003E\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003Egetch();\u0026nbsp;\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u003Cspan class=\"Apple-tab-span\" style=\"white-space: pre;\"\u003E \u003C\/span\u003Ereturn 0;\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E}\u003C\/span\u003E\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns1.html#p7\" name=\"p7\"\u003E7. Program to print the given pattern\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Program to print the given patter :\n\n\/* \n\n1 2 3 4 5\n1 2 3 4\n1 2 3\n1 2\n1\n\n*\/\n\n\/* \n\nREMEMBER : We always design logic according to the pattern.\n\nLOGIC:\n\nConsider the diagonal to be rows and a single line to be column.\n\nNumber of loops required = 2 \n( since we have rows and columns. 1 loop for row and 1 loop for column. )\n\nIt would be a nested loop since Number of columns depends on Number of rows.\n\nOuter loop will be for rows and inner loop will be for columns.\n\nouter loop \"i\" runs from 5 to 1 since we have 5 rows.\nWe run the \"i\" loop in decreasing order ( i.e from 5 to 1 ) \nsince rows is in decreasing order(5 4 3 ... 1 diagnol value)\n\nNotice in above pattern Number of columns = Position of rows \n( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\nWe run the \"j\" loop i.e the inner loop from 1 to i.\nWe run the \"j\" loop in increasing order ( i.e from 1 to i ) \nsince rows is in increasing order(1 2 3 ... i single line value)\n\nWe print \"value\" in the inner loop \nsince number of columns = number of \"value\" to be printed.\nNOTE : WE CAN PRINT ANYTHING WHICH WE WANT. ( for ex : printf(\"%d\",j) or printf(\"%d\",i) or anything according to pattern.\n\nLastly after one rotation (completion) of inner loop we need to go to the next line so we use printf(\"\\n\") statement after closing the \ninner loop and before closing the outer loop.\n\nComments are given to make you understand the program..\n\n*\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\nint main()\n{\n\/\/ Declaring variable i,j to iterate outer and inner loop respectively\n\/\/ we are using \"i\" for rows and \"j\" for columns\nint i,j;\n\n\/\/ Since we have five rows so we iterate the \"i\" loop from 5 to 1 ( i.e 5 times )\n\/\/ We run the \"i\" loop in decreasing order ( i.e from 5 to 1 ) since rows is in decreasing order(5 4 3 ... 1 diagnol value)\nfor(i=5;i\u0026gt;=1;i--)\n{\n\/\/ Notice in above pattern Number of columns = Position of rows ( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\n\/\/ We run the \"j\" loop in increasing order ( i.e from 1 to i ) since rows is in increasing order(1 2 3 ... i single line value)\nfor(j=1;j\u0026lt;=i;j++)\n{\n\/* Printing \"value\" in the inner loop since number of columns = number of \"value\" to be printed.\nHere we print the value of \"j\" since value to be printed is the position of the column according to initialisation in loop. *\/\n\nprintf(\"%d \",j);\n}\n  \n\/\/ After completion of printing \"value\" in row we need to go to the next row.\nprintf(\"\\n\");\n}\n \ngetch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003C\/pre\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003Ereturn 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns1.html#p8\" name=\"p8\"\u003E8. Program to print the given pattern\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Program to print the given patter :\n\n\/* \n\n5 4 3 2 1\n5 4 3 2\n5 4 3\n5 4\n5\n\n*\/\n\n\/* \n\nREMEMBER : We always design logic according to the pattern.\n\nLOGIC:\n\nConsider the diagonal to be rows and a single line to be column.\n\nNumber of loops required = 2 \n( since we have rows and columns. 1 loop for row and 1 loop for column.)\n\nIt would be a nested loop since Number of columns depends on Number of rows.\n\nOuter loop will be for rows and inner loop will be for columns.\n\nouter loop \"i\" runs from 1 to 5 since we have 5 rows.\nWe run the \"i\" loop in increasing order \n( i.e from 1 to 5 ) since rows is in increasing order(1 2 3 4 5 diagnol value)\n\nNotice in above pattern Number of columns = Position of rows \n( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\nWe run the \"j\" loop i.e the inner loop from 1 to i.\nWe run the \"j\" loop in decreasing order ( i.e from 5 to i ) \nsince rows is in decreasing order(5 4 ... i single line value)\n\nWe print \"value\" in the inner loop \nsince number of columns = number of \"value\" to be printed.\nNOTE : WE CAN PRINT ANYTHING WHICH WE WANT. ( for ex : printf(\"%d\",j) or printf(\"%d\",i) or anything according to pattern.\n\nLastly after one rotation (completion) of inner loop we need to go to the next line so we use printf(\"\\n\") statement after closing the \ninner loop and before closing the outer loop.\n\nComments are given to make you understand the program..\n\n*\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\nint main()\n{\n\/\/ Declaring variable i,j to iterate outer and inner loop respectively\n\/\/ we are using \"i\" for rows and \"j\" for columns\nint i,j;\n \n\/* Since we have five rows so we iterate the \"i\" loop from 5 to 1 ( i.e 5 times )\nWe run the \"i\" loop in decreasing order ( i.e from 5 to 1 ) \nsince rows is in decreasing order(5 4 3 ... 1 diagnol value) *\/\n \nfor(i=1;i\u0026lt;=5;i++)\n{\n\/* Notice in above pattern Number of columns = Position of rows ( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\nWe run the \"j\" loop in increasing order ( i.e from 1 to i ) since rows is in increasing order(1 2 3 ... i single line value) *\/\nfor(j=5;j\u0026gt;=i;j--)\n{\n\/* Printing \"value\" in the inner loop since number of columns = number of \"value\" to be printed.\nHere we print the value of \"j\" since value to be printed is the position of the column according to initialisation in loop. *\/\n   \nprintf(\"%d \",j);\n}\n \n\/\/ After completion of printing \"value\" in row we need to go to the next row.\nprintf(\"\\n\");\n}\n\ngetch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\nreturn 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns1.html#p9\" name=\"p9\"\u003E9. Program to print the given pattern\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Program to print the given patter :\n\n\/* \n        *\n      * *\n    * * *\n  * * * *\n* * * * *\n\n\n*\/\n\n\/* \n\nREMEMBER : We always design logic according to the pattern.\n\nLOGIC:\n\nSimplifying the pattern :\n\n--------*\n------* *\n----* * *\n--* * * *\n* * * * *\n\nHere ( - ) indicates space before star ( asterik ) to be printed.\ni.e -- indicates two space, ---- indicates four space and so on.\n\nThe above pattern is similar to pattern :\n*\n* *\n* * *\n* * * *\n* * * * *\n\nThe only difference is we print spaces before the \"values\". \nSo design logic according to this and print spaces before that.\nIts as simple as you like.\n\nConsider the diagonal to be rows and a single line to be column.\n\nNow earlier we worked only on rows and columns without spaces before the printed \"value\" \nbut now we have spcaes as well. So we include another loop for spaces.\n\nNumber of loops required = 3 \n( since we have rows and columns and also spaces. 1 loop for row and 1 loop for column \nand 1 loop for spaces.)\n\nIt would be a nested loop since Number of columns depends on Number of rows.\n\nOuter loop will be for rows and inner loop will be for columns. \nOne more inner loop will be for printing space.\n\nouter loop \"i\" runs from 1 to 5 since we have 5 rows.\n\nNotice in above pattern Number of columns = Position of rows \n( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\nWe run the \"j\" loop i.e the inner loop from 1 to i.\n\nNow For spaces : If you notice the spaces are in decreasing manner \n( i.e 8 spaces, 6 spaces, 4 spaces, 2 spaces and then none )\nWe can print the spaces by utilising \"i\" value \nbut to simplify the pattern and make it easier we use another value m=8 and \nreduce it by 2 after the completion of loop for spaces.\ni.e We run the inner loop \"s\" from 1 to m.\n\nWe print \"value\" in the inner loop \nsince number of columns = number of \"value\" to be printed.\nNOTE : WE CAN PRINT ANYTHING WHICH WE WANT. ( for ex : printf(\"%d\",j) or printf(\"%d\",i) or anything according to pattern.\n\nLastly after one rotation (completion) of inner loop we need to go to the next line so we use printf(\"\\n\") statement after closing the \ninner loop and before closing the outer loop.\n\nComments are given to make you understand the program..\n\n*\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\nint main()\n{\n\/\/ Declaring variable i, j, s to iterate outer and inner loop respectively\n\/\/ we are using \"i\" for rows, \"j\" for columns ans \"s\" for spaces.\nint i, j, s;\n \n\/\/ Initialising m = 8 as total number of space = 8\nint m = 8;\n \n\/\/ Since we have five rows so we iterate the \"i\" loop from 5 to 1 ( i.e 5 times )\nfor(i=1;i\u0026lt;=5;i++)\n{\n\/\/ Printing spaces\nfor(s=1;s\u0026lt;=m;s++)\n{\nprintf(\" \");\n}\n\/\/ Reducing value of \"m\" by 2 to reduce spaces\nm=m-2;\n  \n\/* Notice in above pattern Number of columns = Position of rows ( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on ) *\/\nfor(j=1;j\u0026lt;=i;j++)\n{\n\/\/ Printing \"value\" in the inner loop since number of columns = number of \"value\" to be printed.\nprintf(\"* \");\n}\n  \n\/\/ After completion of printing \"value\" in row we need to go to the next row.\nprintf(\"\\n\");\n}\n \ngetch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\nreturn 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns1.html#p10\" name=\"p10\"\u003E10. Program to print the given pattern\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Program to print the given patter :\n\n\/* \n        1\n      1 2\n    1 2 3\n  1 2 3 4\n1 2 3 4 5\n\n\n*\/\n\n\/* \n\nREMEMBER : We always design logic according to the pattern.\n\nLOGIC:\n\nSimplifying the pattern :\n\n--------1\n------1 2\n----1 2 3\n--1 2 3 4\n1 2 3 4 5\n\nHere ( - ) indicates space before \"value\" to be printed.\ni.e -- indicates two space, ---- indicates four space and so on.\n\nThe above patter is similar to patern:\n1\n1 2\n1 2 3\n1 2 3 4\n1 2 3 4 5\n\nThe only difference is we print spaces before the \"values\". \nSo design logic according to this and print spaces before that.\nIts as simple as you like.\n\nConsider the diagonal to be rows and a single line to be column.\n\nNow earlier we worked only on rows and columns without spaces before the printed \"value\" \nbut now we have spcaes as well. So we include another loop for spaces.\n\nNumber of loops required = 3 \n( since we have rows and columns and also spaces. 1 loop for row and 1 loop for column \nand 1 loop for spaces.)\n\nIt would be a nested loop since Number of columns depends on Number of rows.\n\nOuter loop will be for rows and inner loop will be for columns. \nOne more inner loop will be for printing space.\n\nouter loop \"i\" runs from 1 to 5 since we have 5 rows.\nWe run the \"i\" loop in increasing order ( i.e from 1 to 5 ) \nsince rows is in increasing order(1 2 3 4 5 diagnol value)\n\nNotice in above pattern Number of columns = Position of rows \n( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\nWe run the \"j\" loop i.e the inner loop from 1 to i.\nWe run the \"j\" loop in increasing order ( i.e from 1 to i ) \nsince column is in increasing order(1 2 3 4 5 single line value)\n\nNow For spaces : If you notice the spaces are in decreasing manner \n( i.e 8 spaces, 6 spaces, 4 spaces, 2 spaces and then none )\nWe can print the spaces by utilising \"i\" value but to simplify the pattern \nand make it easier we use another value m=8 and \nreduce it by 2 after the completion of loop for spaces.\ni.e We run the inner loop \"s\" from 1 to m.\n\nWe print \"value\" in the inner loop \nsince number of columns = number of \"value\" to be printed.\nNOTE : WE CAN PRINT ANYTHING WHICH WE WANT. ( for ex : printf(\"%d\",j) or printf(\"%d\",i) or anything according to pattern.\n\nLastly after one rotation (completion) of inner loop we need to go to the next line so we use printf(\"\\n\") statement after closing the \ninner loop and before closing the outer loop.\n\nComments are given to make you understand the program..\n\n*\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\nint main()\n{\n\/\/ Declaring variable i, j, s to iterate outer and inner loop respectively\n\/\/ we are using \"i\" for rows, \"j\" for columns ans \"s\" for spaces.\nint i, j, s;\n \n\/\/ Initialising m = 8 as maximum number of space = 8\nint m = 8;\n \n\/\/ Since we have five rows so we iterate the \"i\" loop from 5 to 1\n\/* We run the \"i\" loop in increasing order ( i.e from 1 to 5 ) \nsince rows is in increasing order(1 2 3 4 5 diagnol value) *\/\n\nfor(i=1;i\u0026lt;=5;i++)\n{\n\/\/ Printing spaces\nfor(s=1;s\u0026lt;=m;s++)\n{\nprintf(\" \");\n}\n\/\/ Reducing value of \"m\" by 2 to reduce spaces\nm=m-2;\n  \n\/* Notice in above pattern Number of columns = Position of rows \n( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\nWe run the \"j\" loop in increasing order ( i.e from 1 to i ) \nsince column is in increasing order(1 2 ... i single line value) *\/\n\nfor(j=1;j\u0026lt;=i;j++)\n{\n\/\/ Printing \"value\" in the inner loop since number of columns = number of \"value\" to be printed.\n\/* Here we print the value of \"j\" since value to be printed is the position of the column according to initialisation in loop. *\/\n\nprintf(\"%d \",j);\n}\n  \n\/\/ After completion of printing \"value\" in row we need to go to the next row.\nprintf(\"\\n\");\n}\n \ngetch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\nreturn 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"color: yellow;\"\u003EMore Informative posts :\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns.html\"\u003EC Programs Pattern ( 1-5 )\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-pointers2.html\"\u003EC Programs Pattern ( 11-15 )\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns3.html\"\u003EC Programs Pattern ( 16-20 )\u003C\/a\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003C\/div\u003E\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comp-psyche.com\/feeds\/5719397974851199886\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns1.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/5719397974851199886"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/5719397974851199886"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns1.html","title":"C PROGRAMS : PATTERN"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-7371601159561510038"},"published":{"$t":"2014-02-01T23:05:00.000-08:00"},"updated":{"$t":"2014-07-15T20:47:13.643-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"C Programs"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Pattern"}],"title":{"type":"text","$t":"C PROGRAMS : PATTERN"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Ctitle\u003EC PROGRAMS : PATTERN\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns.html#p1\" name=\"p1\"\u003E1. Program to print the given pattern\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/* \n\n* \n* * \n* * * \n* * * * \n* * * * * \n\n*\/\n\n\/* \n\nREMEMBER : We always design logic according to the pattern.\n\nLOGIC:\n\nNumber of loops required = 2 \n(since we have rows and columns. 1 loop for row and 1 loop for column.)\n\nIt would be a nested loop since Number of columns depends on Number of rows.\n\nOuter loop will be for rows and inner loop will be for columns.\nouter loop \"i\" runs from 1 to 5 since we have 5 rows.\n\nNotice in above pattern Number of columns = Position of rows \n( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\nso we run the \"j\" loop i.e the inner loop from 1 to \"i\".\n\nWe print \"*\" in the inner loop since number of columns = number of star to be printed.\nNOTE : WE CAN PRINT ANYTHING WHICH WE WANT. ( for ex : printf(\"%d\",j) or printf(\"%d\",i) or anything according to pattern.\n\nLastly after one rotation (completion) of inner loop we need to go to the next line so we use printf(\"\\n\") statement after closing the \ninner loop and before closing the outer loop.\n\nComments are given to make you understand the program..\n\n*\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\nint main()\n{\n \/\/ Declaring variable i,j to iterate outer and inner loop respectively\n \/\/ we are using \"i\" for rows and \"j\" for columns\n int i,j;\n \n \/\/ Since we have five rows so we iterate the \"i\" loop from 1 to 5 ( i.e 5 times )\n for(i=1;i\u0026lt;=5;i++)\n {\u003C\/span\u003E\u003C\/pre\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E    \/* Notice in above pattern Number of columns = Position of rows \n    ( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\n    so we run the \"j\" loop i.e the inner loop from 1 to \"i\". *\/\n  \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E  for(j=1;j\u0026lt;=i;j++)\n    {\n   \/\/ Printing \"*\" in the inner loop since number of columns=number of star to be printed\n   printf(\"* \");\n    }\n  \n  \/\/ After completion of printing \"*\" in row we need to go to the next row.\n  printf(\"\\n\");\n }\n \n getch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n return 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns.html#p2\" name=\"p2\"\u003E2. Program to print the given pattern\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Program to print the given patter :\n\n\/* \n\n* \n* * \n* * * \n* * * * \n* * * * * \n* * * * * * ..... till n rows\n\nHere n = any integer value entered by user.\n  n represents rows.\n  \nExample : \n\nFor n=3\n\n*\n* * \n* * *\n\nFor n=5\n\n* \n* * \n* * *\n* * * *\n* * * * * \n\n*\/\n\n\/*\n\nREMEMBER : We always design logic according to the pattern. \n\nLOGIC:\n\nIn above Pattern Number of rows = n\n\nNumber of loops required = 2 \n( since we have rows and columns. 1 loop for row and 1 loop for column. )\n\nIt would be a nested loop since Number of columns depends on Number of rows.\n\nOuter loop will be for rows and inner loop will be for columns.\nouter loop \"i\" runs from 1 to n since we have n rows.\n\nNotice in above pattern Number of columns = Position of rows \n( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\nso we run the \"j\" loop i.e the inner loop from 1 to \"i\".\n\nWe print \"*\" in the inner loop since number of columns = number of star to be printed.\nNOTE : WE CAN PRINT ANYTHING WHICH WE WANT. ( for ex : printf(\"%d\",j) or printf(\"%d\",i) or anything according to pattern.\n\nLastly after one rotation (completion) of inner loop we need to go to the next line so we use printf(\"\\n\") statement after closing the \ninner loop and before closing the outer loop.\n\nComments are given to make you understand the program..\n\n*\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\nint main()\n{\n \/\/ Declaring variable i,j to iterate outer and inner loop respectively\n \/\/ we are using \"i\" for rows and \"j\" for columns\n int i,j;\n \n \/\/Declaring Variale n=rows\n int n;\n \n \/\/ Entering number of rows from user\n printf(\"Enter number of rows : \");\n scanf(\"%d\",\u0026amp;n);\n \n \/\/ Since we have \"n\" number of  rows so we iterate the \"i\" loop from 1 to n\n for(i=1;i\u0026lt;=n;i++)\n {\n  \/* Notice in above pattern Number of columns = Position of rows \n  ( i.e 1st row has 1 column, 2nd row has 2 column and so on )\n   so we run the \"j\" loop i.e the inner loop from 1 to \"i\". *\/\n  for(j=1;j\u0026lt;=i;j++)\n  {\n   \/* Printing \"*\" in the inner loop \n   since number of columns = number of star to be printed. *\/\n   printf(\"* \");\n  }\n  \n  \/\/ After completion of one row we need to go to the next line.\n  printf(\"\\n\");\n }\n \n getch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n return 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns.html#p3\" name=\"p3\"\u003E3. Program to print the given pattern\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ NOTE : For Better understanding read both LOGIC and COMMENTS\n\n\/\/ Program to print the given patter :\n\n\/* \n\n1\n1 2\n1 2 3\n1 2 3 4\n1 2 3 4 5 .... till n rows\n\nHere n = any integer value entered by user.\n  n represents rows.\n\nExample :\n\nFor n=2\n\n1\n1 2\n\nFor n=6\n\n1\n1 2\n1 2 3\n1 2 3 4\n1 2 3 4 5 \n1 2 3 4 5 6\n\n*\/\n\n\/* \n\nREMEMBER : We always design logic according to the pattern.\n\nLOGIC:\n\nIn above Pattern Number of rows = n\n\nConsider the diagonal to be rows and a single line to be column.\n\nNumber of loops required = 2 \n( since we have rows and columns. 1 loop for row and 1 loop for column. )\n\nIt would be a nested loop since Number of columns depends on Number of rows.\n\nOuter loop will be for rows and inner loop will be for columns.\nouter loop \"i\" runs from 1 to n since we have n rows.\nWe run the \"i\" loop in increasing order ( i.e from 1 to n ) \nsince rows is in increasing order(1 2 3 ... n diagnol value)\n\n\nNotice in above pattern Number of columns = Position of rows \n( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\nso we run the \"j\" loop i.e the inner loop from 1 to \"i\".\nWe run the \"j\" loop in increasing order ( i.e from 1 to i ) \nsince column is in increasing order ( 1 2 3 ... i single line value )\n\nWe print \"value\" in the inner loop since number of columns = number of \"values\" to be printed.\nNOTE : WE CAN PRINT ANYTHING WHICH WE WANT. ( for ex : printf(\"%d\",j) or printf(\"%d\",i) or anything according to pattern.\n\nLastly after one rotation (completion) of inner loop we need to go to the next line so we use printf(\"\\n\") statement after closing the \ninner loop and before closing the outer loop.\n\nComments are given to make you understand the program..\n\n*\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\nint main()\n{\n \/\/ Declaring variable i,j to iterate outer and inner loop respectively\n \/\/ we are using \"i\" for rows and \"j\" for columns\n int i,j;\n \n \/\/Declaring Variale n=rows\n int n;\n \n \/\/ Entering number of rows from user\n printf(\"Enter number of rows : \");\n scanf(\"%d\",\u0026amp;n);\n \n \/\/ Since we have five rows so we iterate the \"i\" loop from 1 to 5\n for(i=1;i\u0026lt;=n;i++)\n {\n  \/* Notice in above pattern Number of columns = Position of rows \n  ( i.e 1st row has 1 column, 2nd row has 2 column and so on )\n   so we run the \"j\" loop from 1 to \"i\" *\/\n  for(j=1;j\u0026lt;=i;j++)\n  {\n   \/* Printing \"value\" in the inner loop \n   since number of columns=number of \"value\" to be printed.\n   Here we print the value of \"j\" \n   since value to be printed is the position of the column. *\/\n   printf(\"%d \",j);\n  }\n  \n  \/* After completion of printing \"value\" in row\n   we need to go to the next row. *\/\n  printf(\"\\n\");\n }\n \n getch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n return 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns.html#p4\" name=\"p4\"\u003E4. Program to print the given pattern\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Program to print the given patter :\n\n\/* \n\n1\n2 2\n3 3 3\n4 4 4 4\n5 5 5 5 5 .... till n rows\n\nHere n = any integer value entered by user.\n  n represents rows.\n\nExample :\n\nFor n=3\n\n1\n2 2\n3 3 3\n\nFor n=6\n\n1\n2 2 \n3 3 3 \n4 4 4 4\n5 5 5 5 5\n6 6 6 6 6 6\n\n*\/\n\n\/* \n\nREMEMBER : We always design logic according to the pattern.\n\nLOGIC:\n\nIn above Pattern Number of rows = n\n\nNumber of loops required = 2 \n( since we have rows and columns. 1 loop for row and 1 loop for column. )\n\nIt would be a nested loop since Number of columns depends on Number of rows.\n\nOuter loop will be for rows and inner loop will be for columns.\nouter loop \"i\" runs from 1 to n since we have n rows.\n\nNotice in above pattern Number of columns = Position of rows \n( i.e 1st row has 1 column, 2nd row has 2 column, 3rd row has 3 columns and so on )\nso we run the \"j\" loop i.e the inner loop from 1 to \"i\".\n\nWe print \"value\" in the inner loop \nsince number of columns = number of \"values\" to be printed.\nNOTE : WE CAN PRINT ANYTHING WHICH WE WANT. ( for ex : printf(\"%d\",j) or printf(\"%d\",i) or anything according to pattern.\n\nLastly after one rotation (completion) of inner loop we need to go to the next line so we use printf(\"\\n\") statement after closing the \ninner loop and before closing the outer loop.\n\nComments are given to make you understand the program..\n\n*\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\nint main()\n{\n \/\/ Declaring variable i,j to iterate outer and inner loop respectively\n \/\/ we are using \"i\" for rows and \"j\" for columns\n int i,j;\n \n \/\/Declaring Variale n=rows\n int n;\n \n \/\/ Entering number of rows from user\n printf(\"Enter number of rows : \");\n scanf(\"%d\",\u0026amp;n);\n \n \/\/ Since we have five rows so we iterate the \"i\" loop from 1 to 5\n for(i=1;i\u0026lt;=n;i++)\n {\n  \/* Notice in above pattern Number of columns = Position of rows \n  ( i.e 1st row has 1 column, 2nd row has 2 column and so on )\n   so we run the \"j\" loop from 1 to \"i\" *\/\n   \n  for(j=1;j\u0026lt;=i;j++)\n  {\n   \/* Printing \"value\" in the inner loop \n   since number of columns = number of \"value\" to be printed.\n   Here we print the value of \"i\" \n   since value to be printed is the position of the row. *\/\n   \n   printf(\"%d \",i);\n  }\n  \n  \/* After completion of printing \"value\" in row \n  we need to go to the next row. *\/\n  printf(\"\\n\");\n }\n \n getch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n return 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns.html#p5\" name=\"p5\"\u003E5. Program to print the given pattern\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\n\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Program to print the given patter :\n\n\/* \n\n1 1 1 1 1\n2 2 2 2 2\n3 3 3 3 3\n4 4 4 4 4\n5 5 5 5 5\n\n*\/\n\n\/* \n\nREMEMBER : We always design logic according to the pattern.\n\nLOGIC:\n\nNumber of loops required = 2 \n( since we have rows and columns. 1 loop for row and 1 loop for column. )\n\nIt would be a nested loop since Number of columns depends on Number of rows.\n\nOuter loop will be for rows and inner loop will be for columns.\nouter loop \"i\" runs from 1 to 5 since we have 5 rows.\n\nInner loop also runs from 1 to 5 since we have 5 columns in each row.\nso we run the \"j\" loop i.e the inner loop from 1 to 5.\n\nWe print \"value\" in the inner loop \nsince number of columns = number of \"value\" to be printed.\nNOTE : WE CAN PRINT ANYTHING WHICH WE WANT. ( for ex : printf(\"%d\",j) or printf(\"%d\",i) or anything according to pattern.\n\nLastly after one rotation (completion) of inner loop we need to go to the next line so we use printf(\"\\n\") statement after closing the \ninner loop and before closing the outer loop.\n\nComments are given to make you understand the program..\n\n*\/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\nint main()\n{\n \/\/ Declaring variable i,j to iterate outer and inner loop respectively\n \/\/ we are using \"i\" for rows and \"j\" for columns\n int i,j;\n \n \/\/ Since we have five rows so we iterate the \"i\" loop from 1 to 5\n for(i=1;i\u0026lt;=5;i++)\n {\n  \/\/ We have five columns as well so we iterate the \"j\" loop from 1 to 5.\n  for(j=1;j\u0026lt;=5;j++)\n  {\n   \/* Printing \"value\" in the inner loop \n   since number of columns = number of \"value\" to be printed.\n   Here we print the value of \"i\" \n   since value to be printed is the position of the row. *\/\n   \n   printf(\"%d \",i);\n  }\n  \n  \/* After completion of printing \"*\" in row \n  we need to go to the next row. *\/\n  \n  printf(\"\\n\");\n }\n \n getch(); \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n\u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\n return 0;\n}\u003C\/span\u003E\n\u003C\/pre\u003E\n\u003C\/div\u003E\n\u003C\/div\u003E\n\u003Cbr \/\u003E\n\u003Cspan style=\"color: yellow;\"\u003EMore Informative posts : \u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cbr \/\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns1.html\"\u003EC Programs Pattern ( 6-10 )\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-pointers2.html\"\u003EC Programs Pattern ( 11-15 )\u003C\/a\u003E\u003C\/li\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns3.html\"\u003EC Programs Pattern ( 16-20 )\u003C\/a\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003Cdiv\u003E\n\u003Cspan style=\"color: yellow;\"\u003EOther References :\u0026nbsp;\u003C\/span\u003E\u003C\/div\u003E\n\u003Cdiv\u003E\n\u003Cul style=\"text-align: left;\"\u003E\n\u003Cli\u003E\u003Ca href=\"http:\/\/www.programmingspark.com\/search\/label\/Pattern%20Programming%20in%20C\"\u003ELearn Pattern Programming in C\u003C\/a\u003E\u003C\/li\u003E\n\u003C\/ul\u003E\n\u003C\/div\u003E\n\u003C\/div\u003E\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https:\/\/www.comp-psyche.com\/feeds\/7371601159561510038\/comments\/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/7371601159561510038"},{"rel":"self","type":"application/atom+xml","href":"https:\/\/www.blogger.com\/feeds\/8285804830535272268\/posts\/default\/7371601159561510038"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/2014\/02\/c-programs-patterns.html","title":"C PROGRAMS : PATTERN"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"http:\/\/www.blogger.com\/profile\/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"16","height":"16","src":"https:\/\/img1.blogblog.com\/img\/b16-rounded.gif"}}],"thr$total":{"$t":"0"}}]}});