gdata.io.handleScriptLoaded({"version":"1.0","encoding":"UTF-8","feed":{"xmlns":"http://www.w3.org/2005/Atom","xmlns$openSearch":"http://a9.com/-/spec/opensearchrss/1.0/","xmlns$gd":"http://schemas.google.com/g/2005","xmlns$georss":"http://www.georss.org/georss","xmlns$thr":"http://purl.org/syndication/thread/1.0","xmlns$blogger":"http://schemas.google.com/blogger/2008","id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268"},"updated":{"$t":"2023-07-30T02:11:08.392-07:00"},"category":[{"term":"C Programs"},{"term":"Pointers"},{"term":"string"},{"term":"Array"},{"term":"Learn C"},{"term":"Fundamental"},{"term":"Pattern"},{"term":"control sturctures"},{"term":"searching and sorting"},{"term":"recursion"},{"term":"List of C Programs"},{"term":"Structures"},{"term":"C Turbo Compiler"},{"term":"File Handling"},{"term":"Contents"},{"term":"Common Programming Error"},{"term":"functions"},{"term":"Dynamic memory allcation"}],"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.blogger.com/feeds/8285804830535272268/posts/default/-/control+sturctures?alt\u003djson-in-script\u0026max-results\u003d50"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/-/control+sturctures?alt\u003djson-in-script\u0026max-results\u003d50"},{"rel":"alternate","type":"text/html","href":"http://www.comp-psyche.com/search/label/control%20sturctures"},{"rel":"hub","href":"http://pubsubhubbub.appspot.com/"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"generator":{"version":"7.00","uri":"https://www.blogger.com","$t":"Blogger"},"openSearch$totalResults":{"$t":"7"},"openSearch$startIndex":{"$t":"1"},"openSearch$itemsPerPage":{"$t":"50"},"entry":[{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-3065824922547362513"},"published":{"$t":"2014-01-29T03:54:00.000-08:00"},"updated":{"$t":"2014-06-12T02:15:04.384-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"control sturctures"},{"scheme":"http://www.blogger.com/atom/ns#","term":"C Programs"}],"title":{"type":"text","$t":"C PROGRAMS : ENCODE AND DECODE ( CIPHER )"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-encode-and-decode-cipher.html#cipher\" name\u003d\"cipher\"\u003eProgram to encode and decode ( cipher )\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\n\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n // Declaring variable for pt\u003dplaint text, ct\u003dcipher text\n char pt[20],ct[20];\n int l\u003d0,i,j,k\u003d0;\n int kl,key[20];\n printf(\"%d\",(-27%26));\n printf(\"Enter string:\");\n gets(pt);\n while(pt[l]!\u003d'\\0')\n l++;\n \n printf(\"Enter key length:\");\n scanf(\"%d\",\u0026amp;kl);\n printf(\"Enter key:\");\n for(i\u003d0;i\u0026lt;kl;i++)\n {\n  scanf(\"%d\",\u0026amp;key[i]);\n }\n if(kl!\u003dl)\n {\n for(i\u003dkl;i\u0026lt;l;i++)\n {\n  if(k\u003d\u003dkl)\n  {\n  k\u003dk-kl;\n  key[i]\u003dkey[k];\n  k++;\n  }\n  else\n  {\n  key[i]\u003dkey[k];\n  k++;\n   }\n }\n }\n printf(\"Key Sequence: \");\n for(i\u003d0;i\u0026lt;l;i++)\n {\n  printf(\"%d \",key[i]);\n }\n \n // Encrypting\n  for(i\u003d0;i\u0026lt;l;i++)\n {\n  // For small letter\n  if(pt[i]\u0026gt;\u003d97 \u0026amp;\u0026amp; pt[i]\u0026lt;\u003d122)\n  ct[i]\u003d(((pt[i]-97)+key[i])%26)+97; \n  \n  // For capital letter\n  else if(pt[i]\u0026gt;\u003d65 \u0026amp;\u0026amp; pt[i]\u0026lt;\u003d90)\n  ct[i]\u003d(((pt[i]-65)+key[i])%26)+65;\n  \n  // For digits \n  else if(pt[i]\u0026gt;\u003d48 \u0026amp;\u0026amp; pt[i]\u0026lt;\u003d57)\n  ct[i]\u003d(((pt[i]-48)+key[i])%10)+48;\n  \n  // For special Charactrer\n  else if(pt[i]\u0026gt;\u003d33 \u0026amp;\u0026amp; pt[i]\u0026lt;\u003d47)\n  ct[i]\u003d(((pt[i]-33)+key[i])%15)+33;\n  \n  else if(pt[i]\u0026gt;\u003d58 \u0026amp;\u0026amp; pt[i]\u0026lt;\u003d64)\n  ct[i]\u003d(((pt[i]-58)+key[i])%7)+58;\n  \n  else if(pt[i]\u0026gt;\u003d91 \u0026amp;\u0026amp; pt[i]\u0026lt;\u003d96)\n  ct[i]\u003d(((pt[i]-91)+key[i])%6)+91;\n  \n  else if(pt[i]\u0026gt;\u003d123 \u0026amp;\u0026amp; pt[i]\u0026lt;\u003d126)\n  ct[i]\u003d(((pt[i]-123)+key[i])%4)+123;\n  \n  // For space \n  else if(pt[i]\u003d\u003d' ')\n  ct[i]\u003dpt[i]+127+key[i]; \n}\n    \n \n printf(\"\\nEncrypted data: \");\n for(i\u003d0;i\u0026lt;l;i++)\n {\n  printf(\"%c\",ct[i]);\n }\n \n // Decrypting\n for(i\u003d0;i\u0026lt;l;i++)\n {\n  // For small letter\n  if(ct[i]\u0026gt;\u003d97 \u0026amp;\u0026amp; ct[i]\u0026lt;\u003d122)\n  {\n   if((((ct[i]-97)-key[i])%26)\u0026lt;0)\n   pt[i]\u003dct[i]-key[i]+26;\n   else\n    pt[i]\u003d(((ct[i]-97)-key[i])%26)+97; \n  }\n  \n  // For capital letter\n  else if(ct[i]\u0026gt;\u003d65 \u0026amp;\u0026amp; pt[i]\u0026lt;\u003d90)\n  {\n   if((((ct[i]-65)-key[i])%26)\u0026lt;0)\n   pt[i]\u003dct[i]-key[i]+26;\n   else\n    pt[i]\u003d(((ct[i]-65)-key[i])%26)+65; \n  }\n  \n  // For digits\n  else if(ct[i]\u0026gt;\u003d48 \u0026amp;\u0026amp; pt[i]\u0026lt;\u003d57)\n  {\n   if((((ct[i]-48)-key[i])%10)\u0026lt;0)\n   pt[i]\u003dct[i]-key[i]+10;\n   else\n    pt[i]\u003d(((ct[i]-48)-key[i])%10)+48; \n \n      }\n      \n  // For special character\n  else if(ct[i]\u0026gt;\u003d33 \u0026amp;\u0026amp; pt[i]\u0026lt;\u003d47)\n  {\n   if((((ct[i]-33)-key[i])%15)\u0026lt;0)\n   pt[i]\u003dct[i]-key[i]+15;\n   else\n    pt[i]\u003d(((ct[i]-33)-key[i])%15)+33; \n \n  }\n  \n   else if(ct[i]\u0026gt;\u003d58 \u0026amp;\u0026amp; pt[i]\u0026lt;\u003d64)\n  {\n   if((((ct[i]-58)-key[i])%7)\u0026lt;0)\n   pt[i]\u003dct[i]-key[i]+7;\n   else\n    pt[i]\u003d(((ct[i]-58)-key[i])%7)+58; \n  }\n  \n   else if(ct[i]\u0026gt;\u003d91 \u0026amp;\u0026amp; pt[i]\u0026lt;\u003d96)\n  {\n   if((((ct[i]-91)-key[i])%6)\u0026lt;0)\n   pt[i]\u003dct[i]-key[i]+6;\n   else\n    pt[i]\u003d(((ct[i]-91)-key[i])%6)+91; \n  }\n  \n   else if(ct[i]\u0026gt;\u003d123 \u0026amp;\u0026amp; pt[i]\u0026lt;\u003d126)\n  {\n   if((((ct[i]-123)-key[i])%4)\u0026lt;0)\n   pt[i]\u003dct[i]-key[i]+4;\n   else\n    pt[i]\u003d(((ct[i]-123)-key[i])%4)+123; \n  }\n  \n  // For space\n  else\n  pt[i]\u003dct[i]-127-key[i];\n  \n }\n \n printf(\"\\nActual Data: \");\n for(i\u003d0;i\u0026lt;l;i++)\n {\n  printf(\"%c\",pt[i]);\n }\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/3065824922547362513/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-encode-and-decode-cipher.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/3065824922547362513"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/3065824922547362513"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-encode-and-decode-cipher.html","title":"C PROGRAMS : ENCODE AND DECODE ( CIPHER )"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-5651101685133285199"},"published":{"$t":"2014-01-29T03:48:00.000-08:00"},"updated":{"$t":"2014-04-16T01:07:25.463-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"control sturctures"},{"scheme":"http://www.blogger.com/atom/ns#","term":"C Programs"}],"title":{"type":"text","$t":"C PROGRAMS : CONTROL STRUCTURES"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eC PROGRAMS : CONTROL STRUCTURES\u003c/title\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures4.html#21\" name\u003d\"21\"\u003e21.Program to award Grades according to the following: \u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e/*\n80% and above GRADE A\n70 to 79%  GRADE B\n60 to 69%  GRADE C\n50 to 59  GRADE D\nLess than 50% FAILED\n\nAssume maximum marks for each subject is 100. \nYou have to take marks input of 5 subject\n*/\n\n// Using if-else\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n // Declaring variable for marks\n int m1,m2,m3,m4,m5;\n \n // Declaring variable for p\u003dpercentage\n int p;\n \n // Inputing marks\n printf(\"Enter marks of 5 subjects:\");\n scanf(\"%d %d %d %d %d\",\u0026amp;m1,\u0026amp;m2,\u0026amp;m3,\u0026amp;m4,\u0026amp;m5);\n \n // Calculating and displaying percentage marks scored\n p\u003d(m1+m2+m3+m4+m5)/5;\n printf(\"Percentage : %d\\n\",p);\n \n // Determining Grades and Displaying it\n if(p\u0026lt;50)\n printf(\"Failed\");\n else if(p\u0026gt;\u003d50 \u0026amp;\u0026amp; p\u0026lt;\u003d59)\n printf(\"Grade D\");\n else if(p\u0026gt;\u003d60 \u0026amp;\u0026amp; p\u0026lt;\u003d69)\n printf(\"Grade C\");\n else if(p\u0026gt;\u003d70 \u0026amp;\u0026amp; p\u0026lt;\u003d79)\n printf(\"Grade B\");\n else\n printf(\"Grade A\");\n  \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\n\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures4.html#22\" name\u003d\"22\"\u003e22.Grade Program without using if-else statement \u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n // Declaring variable for marks\n int m1,m2,m3,m4,m5;\n \n // Declaring variable for p\u003dpercentage\n int p,i,g;\n \n // Inputing marks\n printf(\"Enter marks of 5 subjects:\");\n scanf(\"%d %d %d %d %d\",\u0026amp;m1,\u0026amp;m2,\u0026amp;m3,\u0026amp;m4,\u0026amp;m5);\n \n // Calculating and displaying percentage marks scored\n p\u003d(m1+m2+m3+m4+m5)/5;\n printf(\"Percentage : %d\\n\",p);\n \n // Determining grades and Displaying it\n while(p\u0026lt;50)\n {\n  printf(\"Failed\");\n  break;\n }\n while(p\u0026gt;\u003d50 \u0026amp;\u0026amp; p\u0026lt;\u003d59)\n {\n  printf(\"Grade D\");\n  break;\n }\n while(p\u0026gt;\u003d60 \u0026amp;\u0026amp; p\u0026lt;\u003d69)\n {\n  printf(\"Grade C\");\n  break;\n }\n while(p\u0026gt;\u003d70 \u0026amp;\u0026amp; p\u0026lt;\u003d79)\n {\n  printf(\"Grade B\");\n  break;\n }\n while(p\u0026gt;\u003d80)\n {\n  printf(\"Grade A\");\n  break;\n }\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures4.html#23\" name\u003d\"23\"\u003e23.Program to calculate the sum of individual digits of a number \u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n // Declaring variable for n\u003dnumber, d\u003ddigit\n int n, d, sum\u003d0;\n \n // Inputing number\n printf(\"Enter number: \");\n scanf(\"%d\",\u0026amp;n);\n \n // Determing sum of digits\n while(n!\u003d0)\n {\n  d\u003dn%10;  // Extracting last digit of a number\n  sum\u003dsum+d; // Calculating digit sum\n  n\u003dn/10;  // Extracting first two digits \n  \n }\n \n // Displaying sum of digits\n printf(\"Sum of digits : %d\",sum);\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures4.html#24\" name\u003d\"24\"\u003e24.Program to determine whether a given year is leap year or not \u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n // Declaring variable for y\u003dyear\n int y;\n \n // Inputing year\n printf(\"Enter year to check leap year or not: \");\n scanf(\"%d\",\u0026amp;y);\n \n // Determining and displaying whether leap year or not\n if(y%4\u003d\u003d0)\n {\n  if(y%100\u003d\u003d0 \u0026amp;\u0026amp; y%400!\u003d0)\n  printf(\"Century year, But not a leap year\");\n  else\n  printf(\"Leap year\");\n }\n else\n printf(\"Not a Leap Year\");\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/5651101685133285199/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-control-structures4.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/5651101685133285199"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/5651101685133285199"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-control-structures4.html","title":"C PROGRAMS : CONTROL STRUCTURES"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-2589893277001027602"},"published":{"$t":"2014-01-29T03:36:00.000-08:00"},"updated":{"$t":"2014-04-16T01:07:30.520-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"control sturctures"},{"scheme":"http://www.blogger.com/atom/ns#","term":"C Programs"}],"title":{"type":"text","$t":"C PROGRAMS : CONTROL STRUCTURES"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eC PROGRAMS : CONTROL STRUCTURES\u003c/title\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures3.html#p16\" name\u003d\"p16\"\u003e17.Program to print the fibonacii series till which user wishes \u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e/*\n Fibonacii series: Fibonacii series is one in which the nth term is \n sum of (n-1)th term and (n-2)th term.\n The first two numbers of series are 0 and 1\n For example: 0 1 1 2 3 5 8 13 21 and so on\n */\n \n #include\u0026lt;stdio.h\u0026gt;\n #include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n int main()\n {\n  /* Declaring variable for n\u003dnumber, f\u003dfirst, s\u003dsecond, \n  t\u003dthird number, i\u003dto iterate the loop */\n  int n,f,s,t,i;\n  \n  // Inputing number till where fibonacci series is to be displayed\n  printf(\"Enter the number till which you want to see fibonacci series:\");\n  scanf(\"%d\",\u0026amp;n);\n  \n  // Determining and displaying fibonacii series\n  printf(\"Fibonacii Series: \");\n  \n  f\u003d0;\n  s\u003d1;\n  printf(\"%d %d \",f,s);\n  for(i\u003d3;i\u0026lt;\u003dn;i++)\n  {\n   t\u003df+s;\n   printf(\"%d \",t);\n   f\u003ds;\n   s\u003dt;\n  }\n  getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n  return 0;\n }\u003c/span\u003e\n\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures3.html#p17\" name\u003d\"p17\"\u003e17. Program to determine whether entered character is capital case letter, small case letter, a digit or a special symbol\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n // Declaring variable for c\u003dcharacter\n char c;\n \n // Inputing character\n printf(\"Enter any character: \");\n scanf(\"%c\",\u0026amp;c);\n \n if(c\u0026gt;\u003d65 \u0026amp;\u0026amp; c\u0026lt;\u003d90)\n printf(\"Character is Upper Case Letter\");\n else if(c\u0026gt;\u003d97 \u0026amp;\u0026amp; c\u0026lt;\u003d122)\n printf(\"Character is Lower Case Letter\");\n else if(c\u0026gt;\u003d48 \u0026amp;\u0026amp; c\u0026lt;\u003d57)\n printf(\"Character is a Digit\");\n else\n printf(\"Character is Special Symbol\");\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures3.html#p18\" name\u003d\"p18\"\u003e18.Program to find whether a number is Perfect Square or Not \u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e/*\nA perfect square is a number that can be expressed as the product of two equal integers.\n\n9\n9 is a perfect square becuase it can be expressed as 3 * 3 (product of two equal integers)\n16\n16 is a perfect square becuase it can be expressed as 4 * 4 (product of two equal integers)\n25\n25 is a perfect square becuase it can be expressed as 5 * 5 (product of two equal integers)\n*/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n //Declaring variable for n\u003dnumber\n int n;\n \n // Declaring variable for r\u003dremainder, q\u003duotient, i\u003dto iterate the loop\n int r\u003d0,q\u003d0,i,flag\u003d0;\n \n // Inputting Number\n printf(\"Enter any numbre: \");\n scanf(\"%d\",\u0026amp;n);\n \n // Determin whether Numbr is Perfect Square or Not\n for(i\u003d1;i\u0026lt;\u003dn;i++)\n {\n  r\u003dn%i;\n  q\u003dn/i;\n  if(r\u003d\u003d0 \u0026amp;\u0026amp; i\u003d\u003dq)\n  {\n   flag\u003d1;\n   break;\n  }\n }\n \n // Displaying Result\n if(flag\u003d\u003d1)\n printf(\"Number is Perfect Square\");\n else\n printf(\"Number is not Perfect Square\");\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures3.html#p19\" name\u003d\"p19\"\u003e19.Program to print (list) Perfect Square Number between any two number and display it in the format \u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n /* Declaring variable for r\u003dremainder, q\u003duotient, i,\n m\u003dto iterate the loops, f1\u003dAnother flag variable */\n int r\u003d0, q\u003d0, i, flag\u003d0, f1\u003d0, m;\n \n // Delcaring variable for s\u003dstart point, e\u003dendpoint\n int s,e;\n \n // Inputting start point and end point\n printf(\"Enter from where you want to list perfect Number:\");\n scanf(\"%d\",\u0026amp;s);\n printf(\"Enter till where you want to list perfect Number:\");\n scanf(\"%d\",\u0026amp;e);\n \n // Determin Number is Perfect or Not\n for(m\u003ds;m\u0026lt;\u003de;m++)\n {\n  flag\u003d0;\n for(i\u003d1;i\u0026lt;\u003dm;i++)\n {\n  r\u003dm%i;\n  q\u003dm/i;\n  if(r\u003d\u003d0 \u0026amp;\u0026amp; i\u003d\u003dq)\n  {\n   f1\u003d1;\n   flag\u003d1;\n   break;\n  }\n }\n \n // Displaying Perfect Square Numbre in the given format\n if(flag\u003d\u003d1)\n printf(\"%d is a Perfect Square because it can be expressed as: %d * %d \\n\",m,i,i);\n  }\n  \n /* Checking if any Perfect Square Number exist and if not \n then displaying appropriate message */   \n if(f1\u003d\u003d0)\n printf(\"No Perfect Square Number exist\");\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures3.html#p20\" name\u003d\"p20\"\u003e20. Program for Bank account Handling \u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre style\u003d\"text-align: left;\"\u003e\u003cspan style\u003d\"color: blue;\"\u003eA customer maintains a saving account in a bank. The bank provide an interest rate of \nsimple interest of 4% per annum. Write a program displaying a menu to let the user enter \nthe coice as follows: \n1 : Deposit an amount A\n2 : Withdrawl of amount A\n3 : Displaying the balance amount\n4 : Calculating interest for d days on balance amount\n5 : Exit\nFix initial balance amount \u003d 1000\n*/\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\nint main()\n{\n // Declaring variable for a\u003damount, ba\u003dbalance amount, si\u003dsimple interest\n float a, ba\u003d1000, si;\n \n /* Declaring variable for ch\u003dchoice, d\u003dday, ans\u003dchecks if user \n want to enter another query or choice */\n int ch, d,ans;\n \n // Displaying choices\n printf(\"Bank Queries:\\n\");\n printf(\"1 : Deposit an amount\\n\");\n printf(\"2 : Withdrawl of amount\\n\");\n printf(\"3 : Displaying the balance amount\\n\");\n printf(\"4 : Calculating interest for d days on balance amount\\n\");\n printf(\"5 : exit\\n\\n\");\n \n do\n {\n // Inputing choices\n printf(\"Enter your query:\");\n scanf(\"%d\",\u0026amp;ch);\n \n // Performing various bank queries\n switch(ch)\n {\n  case 1:\n   // Inputing deposit amount\n   printf(\"Enter amount to be deposited:\");\n   scanf(\"%f\",\u0026amp;a);\n   ba\u003dba+a;\n   break;\n  case 2:\n   // Inputing withdrawl amount\n   printf(\"Enter withdrawl amount:\");\n   scanf(\"%f\",\u0026amp;a);\n   ba\u003dba-a;\n   break;\n  case 3:\n   printf(\"Balance Amount: %f\\n\",ba);\n   break;\n  case 4:\n   // Inputing days\n   printf(\"Enter Days for which you want to calculate interest:\");\n   scanf(\"%d\",\u0026amp;d);\n   \n   // Calculating simple interest\n   si\u003d(a*0.04*d)/100;\n   printf(\"Simple interest\u003d%f\\n\",si);\n   ba\u003dba+si;\n   break;\n  case 5:\n   printf(\"Press any key to exit\");\n   getch();\n   exit(0);\n   break;\n   default:\n    printf(\"Wrong Entry\");\n }\n printf(\"Do you want to enter another query: 1-yes, 2-no : \");\n scanf(\"%d\",\u0026amp;ans);\n  }while(ans\u003d\u003d1);\n \n printf(\"Press any key to exit\");\n\u0026nbsp;\u003c/span\u003e\u003c/pre\u003e\u003cpre style\u003d\"text-align: left;\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/2589893277001027602/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-control-structures3.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/2589893277001027602"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/2589893277001027602"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-control-structures3.html","title":"C PROGRAMS : CONTROL STRUCTURES"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-2187229094122062898"},"published":{"$t":"2014-01-29T03:08:00.000-08:00"},"updated":{"$t":"2014-04-16T01:07:34.961-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"control sturctures"},{"scheme":"http://www.blogger.com/atom/ns#","term":"C Programs"}],"title":{"type":"text","$t":"C PROGRAMS : CONTROL STRUCTURES"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eC PROGRAMS : CONTROL STRUCTURES\u003c/title\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures2.html#p11\" name\u003d\"p11\"\u003e11.Program to find whether a given number is Prime or Not \u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n /* Declaring variable for n\u003dnumber, c\u003dcounter variable:holds \n number of factor of 'n' */\n int n,c\u003d0, i;\n \n // Inputting number\n printf(\"Enter number to check whether Prime or Not:\");\n scanf(\"%d\",\u0026amp;n);\n\n // Checking whether number valid or not\n if(n\u0026gt;0)\n {\n  \n // Checking whether number is prime or not \n for(i\u003d1;i\u0026lt;\u003dn;i++)\n {\n  if(n%i\u003d\u003d0)\n  c\u003dc+1;\n }\n \n if(c\u003d\u003d2)\n printf(\"Prime Number\");\n else\n printf(\"Not a Prime Number\");\n }\n \n else \n printf(\"Not a valid Number\");\u003c/span\u003e\u003c/pre\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures2.html#p12\" name\u003d\"p12\"\u003e12.Program to print ( list ) all the prime number between 1 to n \u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n /* Declaring variable for n\u003dnumber, c\u003dcounter variable:holds \n number of factor of 'n' */\n int n,c, i,j;\n \n // Inputting number\n printf(\"Enter number till which you want to list prime number:\");\n scanf(\"%d\",\u0026amp;n);\n\n // Checking whether number valid or not\n \n if(n\u0026gt;0)\n {\n  printf(\"List of Prime Numbers:\");\n // Checking whether number is prime or not \n for(i\u003d1;i\u0026lt;\u003dn;i++)\n {\n  c\u003d0;\n  for(j\u003d1;j\u0026lt;\u003di;j++)\n  {\n  if(i%j\u003d\u003d0)\n  c\u003dc+1;\n  }\n if(c\u003d\u003d2)\n printf(\"%d \",i);\n }\n \n }\n else \n printf(\"Not a valid Number\");\n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures2.html#p13\" name\u003d\"p13\"\u003e13.Program to print (list) Palindrome number from 10 to n\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Palindrome Number: Reverse of Number \u003d Number\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n/*declaring variable for num\u003duser wish, i\u003dacts as number, n\u003dto copy number, \nd\u003ddigit, rev\u003dreverse of number */\nint num,n,d\u003d0,rev,i;\n\n// Inputting number\nprintf(\"Enter number till which you want to list Palindrome Number:\");\nscanf(\"%d\",\u0026amp;num);\n\nprintf(\"List of Palindrome Number:\");\nfor(i\u003d10;i\u0026lt;\u003dnum;i++)\n{\n // copying number in n\n n\u003di;\n rev\u003d0;\n// Determining whether number is palindrome or not\nwhile(n!\u003d0)\n{\n           d\u003dn%10;\n           rev\u003drev*10+d;\n           n\u003dn/10;\n           }\n           \n           // Displaying Whether number is palindrome or not\n           if(i\u003d\u003drev)\n           printf(\"%d \",i);\n       }\n      \n     getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n     return 0;\n     \n     }\u003c/span\u003e\n\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures2.html#p14\" name\u003d\"p11\"\u003e14.Program to print (list) Armstrong Number between two given numbers \u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Armstrong Number: Sum of cube of digit\u003dNumber\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n/*declaring variable for s\u003dstart point, e\u003dend point, i\u003dacts as number, \nn\u003dto copy number, d\u003ddigit, s\u003dsum */\nint s,e,n,d\u003d0,sum,i;\n\n// Inputting number\nprintf(\"Enter form where you want to list Armstrong Number:\");\nscanf(\"%d\",\u0026amp;s);\nprintf(\"Enter number till which you want to list Armstrong Number:\");\nscanf(\"%d\",\u0026amp;e);\n\nprintf(\"List of Armstrong Number:\");\nfor(i\u003ds;i\u0026lt;\u003de;i++)\n{\n // copying number in n\n n\u003di;\n sum\u003d0;\n \n// Determining whether number is pallindrome or not\nwhile(n!\u003d0)\n{\n           d\u003dn%10;\n           sum\u003dsum+(d*d*d);\n           n\u003dn/10;\n }\n           \n           // Displaying Whether number is pallindrome or not\n           if(i\u003d\u003dsum)\n           printf(\"%d \",i);\n }\n      \n     getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n     return 0;\n     \n}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures2.html#p15\" name\u003d\"p11\"\u003e15.Program to print the factor of a given number \u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n // Declaring variable for n\u003dnumbre,i\u003dto iterate the loop\n int n,i;\n \n // Inputing number\n printf(\"Enter any number:\");\n scanf(\"%d\",\u0026amp;n);\n \n // Determining and Displaying factors\n printf(\"Listing Factors of %d :\",n);\n for(i\u003d1;i\u0026lt;\u003dn;i++)\n {\n  if(n%i\u003d\u003d0)\n  printf(\"%d \",i);\n }\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/pre\u003e\u003c/div\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/2187229094122062898/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-control-structures2.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/2187229094122062898"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/2187229094122062898"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-control-structures2.html","title":"C PROGRAMS : CONTROL STRUCTURES"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-5145926858863194990"},"published":{"$t":"2014-01-29T02:51:00.000-08:00"},"updated":{"$t":"2014-04-16T01:07:38.941-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"control sturctures"},{"scheme":"http://www.blogger.com/atom/ns#","term":"C Programs"}],"title":{"type":"text","$t":"C PROGRAMS : CONTROL STUCTURES"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eC PROGRAMS : CONTROL STRUCTURES\u003c/title\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures1.html#p6\" name\u003d\"p6\"\u003e6. Program for finding the factorial of a number\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003c/pre\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003c/pre\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n\n// Variable for n\u003dnumber and fact\u003dfactorial\nint n,fact\u003d1;\n\n// Inputing number whose factorial is to be found\nprintf(\"Enter number:\");\nscanf(\"%d\",\u0026amp;n);\n\n// Calculating Factorial\nwhile(n\u0026gt;\u003d1)\n{\nfact\u003dfact*n;\nn--;\n}\n\n// Diaplaying Factorial\nprintf(\"%d\",fact);\ngetch (); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nreturn 0;\n}\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures1.html#p7\" name\u003d\"p7\"\u003e7. Program to find whether the entered character is vowel or not using if else\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n // Declaring variable where c\u003dcharacter\n char c;\n \n // Inputing character\n printf(\"Enter character:\");\n scanf(\"%c\",\u0026amp;c);\n \n // Determing whether entered character is vowel or not\n if(c\u003d\u003d'a' || c\u003d\u003d'e' || c\u003d\u003d'i' || c\u003d\u003d'o' || c\u003d\u003d'u' || c\u003d\u003d'A' || \n c\u003d\u003d'E' || c\u003d\u003d'I' || c\u003d\u003d'O' || c\u003d\u003d'U')\n {\n printf(\"Entered character is vowel\");\n }\n else\n printf(\"Eneterd character is a constant\");\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures1.html#p8\" name\u003d\"p8\"\u003e8. Program to find whether the entered character is vowel or not using switch case\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n // Declaring variable where c\u003dcharacter\n char c;\n \n // Inputing character\n printf(\"Enter character:\");\n scanf(\"%c\",\u0026amp;c);\n \n// Determing whether entered character is vowel or not\nswitch(c)\n{\n case 'a': case 'A':\n case 'e': case 'E':\n case 'i': case 'I':\n case 'o': case 'O':\n case 'u': case 'U': \n printf(\"Character is vowel\");\n break;\n default:\n  printf(\"Character is a constant\");\n}\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures1.html#p9\" name\u003d\"p9\"\u003e9. Program to print the table of a given number till the user wishes\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n // Declaring Variable for n\u003dnumber, tw\u003dtill where he wants to print the table\n int i, n, tw;\n \n // Inputting number and user wish\n printf(\"Enter the number whose table you want to generate:\");\n scanf(\"%d\",\u0026amp;n);\n printf(\"Enter till where you want to generate table:\");\n scanf(\"%d\",\u0026amp;tw);\n \n // Displaying table\n for(i\u003d1;i\u0026lt;\u003dtw;i++)\n {\n printf(\"%d * %d \u003d %d \\n\",n,i,n*i);\n }\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures1.html#p10\" name\u003d\"p10\"\u003e10. Program to sum up all the integer numbers input at run time until zero is entered\u003c/a\u003e \u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n // Declaring variable for n\u003dnumber, s\u003dsum\n int n,s\u003d0;\n \n do\n {\n // Inputting number\n printf(\"Enter any number:\");\n scanf(\"%d\",\u0026amp;n);\n \n  // Calculating sum until zero is not entered\n  s\u003ds+n;\n }while(n!\u003d0);\n \n // Displaying sum of all integers entered\n printf(\"Sum of all integers\u003d%d\",s);\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/5145926858863194990/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-control-structures1.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/5145926858863194990"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/5145926858863194990"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-control-structures1.html","title":"C PROGRAMS : CONTROL STUCTURES"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-6247751899627272956"},"published":{"$t":"2014-01-29T02:31:00.000-08:00"},"updated":{"$t":"2014-04-16T01:07:45.508-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"control sturctures"},{"scheme":"http://www.blogger.com/atom/ns#","term":"C Programs"}],"title":{"type":"text","$t":"C PROGRAMS : CONTROL STRUCTURES"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eC PROGRAMS : CONTROL STRUCTURES\u003c/title\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures.html#p1\" name\u003d\"p1\"\u003e1. Program to multiply 2 number without using * operator\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n // Variable for 2 numbers, and for result\n int a, b, r\u003d0;\n \n // Inputting 2 integers\n printf(\"Enter two integers:\");\n scanf(\"%d %d\",\u0026amp;a,\u0026amp;b);\n \n // Multiplying 2 numbers\n if(a\u0026gt;b)\n {\n while(b)\n {\n  r\u003dr+a;\n  b--;\n }\n }\n else\n {\n while(a)\n {\n  r\u003dr+b;\n  a--;\n }\n }\n  \n // Displaying result\n printf(\"Product of two number:%d\",r);\n \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures.html#p2\" name\u003d\"p2\"\u003e2. Program to determine armstrong number\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n// variable for a\u003dnumbern, n\u003dto copy number, d\u003ddigit\nint a,n,d\u003d0,sum\u003d0;\n\n// Inputting number\nprintf(\"Enter any number to determine whether it is armstorng or not:\");\nscanf(\"%d\",\u0026amp;a);\n\n// copying number in n\nn\u003da;\n\n// Determining whether number is armstrong or not\nwhile(n!\u003d0)\n{\n           d\u003dn%10;\n           sum\u003dsum+d*d*d;\n           n\u003dn/10;\n}\n           \n// Displaying Whether number is armstrong or not\nif(a\u003d\u003dsum)\nprintf(\"Armstron no\");\nelse\nprintf(\"not armstrong\");\n   \ngetch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nreturn 0;\n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures.html#p3\" name\u003d\"p3\"\u003e3. Program to input time in seconds and convert them into hours, minutes and seconds and display it\u003c/a\u003e\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n /* Variable for time in second, converted in hour, converted in minutes \n and converted in seconds, r for remainder */\n int ts, ch\u003d0, cm\u003d0, cs, r\u003d0;\n \n // Inputting time in second\n printf(\"Enter time in seconds:\");\n scanf(\"%d\", \u0026amp;ts);\n \n // Converting in hours, minutes and seconds \n if(ts\u0026lt;60)\n cs\u003dts;\n \n else if(ts\u0026lt;3600)\n {\n cm\u003dts/60;\n cs\u003dts%60; \n }\n \n else if(ts\u0026gt;3600)\n {\n ch\u003dts/3600;\n r\u003dts%3600;\n if(r\u0026gt;60)\n {\n  cm\u003dr/60;\n  r\u003dr%60;\n }\n if(r\u0026lt;60)\n cs\u003dr;\n }\n \n // Displaying seconds in hour, minutes and seconds\n printf(\"Time in hour minutes and seconds: %d/%d/%d\",ch,cm,cs);\n\u0026nbsp;\u003c/span\u003e\u003c/pre\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n \n}\u003c/span\u003e\n\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures.html#p4\" name\u003d\"p41\"\u003e4. Program to determine palindrome number\u003c/a\u003e \u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\n// variable for a\u003dnumber, n\u003dto copy number, d\u003ddigit, rev\u003dreverse of number\nint a,n,d\u003d0,rev\u003d0;\n\n// Inputting number\nprintf(\"Enter any number to determine whether it is Palindrome or not:\");\nscanf(\"%d\",\u0026amp;a);\n\n// copying number in n\nn\u003da;\n\n// Determining whether number is palindrome or not\nwhile(n!\u003d0)\n{\n           d\u003dn%10;\n           rev\u003drev*10+d;\n           n\u003dn/10;\n           }\n           \n           // Displaying Whether number is palindrome or not\n           if(a\u003d\u003drev)\n           printf(\"Palindrome number\");\n           else\n           printf(\"Not a Palindrome Number\");\n          \n     getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n     return 0;\n     \n     }\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs-control-structures.html#p5\" name\u003d\"p5\"\u003e5. Program showing the use of goto statement\u003c/a\u003e \u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n#include\u0026lt;conio.h\u0026gt; \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint main()\n{\nint i\u003d0;\u003c/span\u003e\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003cpre\u003e\u003cstdio .h\u003d\"\"\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003egoto a;\nna:       \nprintf(\"Not allowed \u003d %d\\n\",i);\na:\n    for(i\u003di+1;i\u0026lt;\u003d35;i++)\n    {\n        if(i\u003d\u003d15||i\u003d\u003d30)\n        goto na;\n        else\n        printf(\"Allowed \u003d%d\\n\",i);\n    }\n        \n getch(); \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e// Linux user - Remove this\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n     \n}\u003c/span\u003e\n\u003c/conio\u003e\u003c/stdio\u003e\u003c/pre\u003e\u003c/div\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/6247751899627272956/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-control-structures.html#comment-form","title":"2 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/6247751899627272956"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/6247751899627272956"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2014/01/c-programs-control-structures.html","title":"C PROGRAMS : CONTROL STRUCTURES"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"2"}},{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-3214615755517805421"},"published":{"$t":"2013-11-18T07:20:00.000-08:00"},"updated":{"$t":"2014-04-16T01:12:37.357-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"Common Programming Error"},{"scheme":"http://www.blogger.com/atom/ns#","term":"control sturctures"},{"scheme":"http://www.blogger.com/atom/ns#","term":"Learn C"}],"title":{"type":"text","$t":"COMMON PROGRAMMING ERRORS - CONTROL STRUCTURES"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ctitle\u003eCOMMON PROGRAMMING ERRORS - CONTROL STRUCTURES\u003c/title\u003e\u003cbr /\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\u003c/div\u003e\u003col\u003e\u003cli\u003eInserting semicolons at the end of expression in for loop or while loop or if or switch.\u0026nbsp;\u003c/li\u003e\n\u003c/ol\u003e\u003cdiv\u003e\u003cb\u003eFor example:\u003c/b\u003e\u003c/div\u003e\u003cdiv class\u003d\"mokcode\"\u003e\u003cspan style\u003d\"color: blue;\"\u003efor ( a \u003d 4; a \u0026lt;\u003d 10; a++);\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003e{\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003e\u0026nbsp; \u0026nbsp;printf ( \"%d\", a );\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: blue;\"\u003e}\u003c/span\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003cdiv style\u003d\"text-align: justify;\"\u003e\u0026nbsp; \u0026nbsp; 2. \u0026nbsp; Not inserting semicolon at the end of expression of while in do-while loop.\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u0026nbsp; \u0026nbsp; 3. \u0026nbsp; Not including curly braces to include if or loop statements.\u003c/div\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u0026nbsp; \u0026nbsp; 4. \u0026nbsp; Using an assignment operator in if expression instead of equality operator.\u003c/div\u003e\u003cdiv\u003e\u003cdiv style\u003d\"text-align: justify;\"\u003e\u0026nbsp; \u003cbr /\u003e\n\u003cdiv\u003e\u003cdiv\u003e\u003cspan style\u003d\"color: yellow;\"\u003eMore Informative Posts:\u003c/span\u003e\u003c/div\u003e\u003cdiv\u003e\u003cul\u003e\u003cli\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/learn-C.html\"\u003eComplete List Of Learn C\u003c/a\u003e\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-complete-list.html\"\u003eCommon Programming Error - Complete List\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-error-function.html\"\u003eCommon Programming Error - Function\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2013/11/common-programming-errors-array.html\"\u003eCommon Programming Error - Array\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/3214615755517805421/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2013/06/common-programming-errors_25.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/3214615755517805421"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/3214615755517805421"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2013/06/common-programming-errors_25.html","title":"COMMON PROGRAMMING ERRORS - CONTROL STRUCTURES"}],"author":[{"name":{"$t":"Mantu Kumar"},"uri":{"$t":"https://www.blogger.com/profile/02897308282659594376"},"email":{"$t":"noreply@blogger.com"},"gd$image":{"rel":"http://schemas.google.com/g/2005#thumbnail","width":"35","height":"35","src":"//www.blogger.com/img/blogger_logo_round_35.png"}}],"thr$total":{"$t":"0"}}]}});