// 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\/-\/control+sturctures?alt=json-in-script\u0026max-results=50"},{"rel":"alternate","type":"text/html","href":"https:\/\/www.comp-psyche.com\/search\/label\/control%20sturctures"},{"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":"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":"C Programs"},{"scheme":"http://www.blogger.com/atom/ns#","term":"control sturctures"}],"title":{"type":"text","$t":"C PROGRAMS : ENCODE AND DECODE ( CIPHER )"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-encode-and-decode-cipher.html#cipher\" name=\"cipher\"\u003EProgram to encode and decode ( cipher )\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 \/\/ Declaring variable for pt=plaint text, ct=cipher text\n char pt[20],ct[20];\n int l=0,i,j,k=0;\n int kl,key[20];\n printf(\"%d\",(-27%26));\n printf(\"Enter string:\");\n gets(pt);\n while(pt[l]!='\\0')\n l++;\n \n printf(\"Enter key length:\");\n scanf(\"%d\",\u0026amp;kl);\n printf(\"Enter key:\");\n for(i=0;i\u0026lt;kl;i++)\n {\n  scanf(\"%d\",\u0026amp;key[i]);\n }\n if(kl!=l)\n {\n for(i=kl;i\u0026lt;l;i++)\n {\n  if(k==kl)\n  {\n  k=k-kl;\n  key[i]=key[k];\n  k++;\n  }\n  else\n  {\n  key[i]=key[k];\n  k++;\n   }\n }\n }\n printf(\"Key Sequence: \");\n for(i=0;i\u0026lt;l;i++)\n {\n  printf(\"%d \",key[i]);\n }\n \n \/\/ Encrypting\n  for(i=0;i\u0026lt;l;i++)\n {\n  \/\/ For small letter\n  if(pt[i]\u0026gt;=97 \u0026amp;\u0026amp; pt[i]\u0026lt;=122)\n  ct[i]=(((pt[i]-97)+key[i])%26)+97; \n  \n  \/\/ For capital letter\n  else if(pt[i]\u0026gt;=65 \u0026amp;\u0026amp; pt[i]\u0026lt;=90)\n  ct[i]=(((pt[i]-65)+key[i])%26)+65;\n  \n  \/\/ For digits \n  else if(pt[i]\u0026gt;=48 \u0026amp;\u0026amp; pt[i]\u0026lt;=57)\n  ct[i]=(((pt[i]-48)+key[i])%10)+48;\n  \n  \/\/ For special Charactrer\n  else if(pt[i]\u0026gt;=33 \u0026amp;\u0026amp; pt[i]\u0026lt;=47)\n  ct[i]=(((pt[i]-33)+key[i])%15)+33;\n  \n  else if(pt[i]\u0026gt;=58 \u0026amp;\u0026amp; pt[i]\u0026lt;=64)\n  ct[i]=(((pt[i]-58)+key[i])%7)+58;\n  \n  else if(pt[i]\u0026gt;=91 \u0026amp;\u0026amp; pt[i]\u0026lt;=96)\n  ct[i]=(((pt[i]-91)+key[i])%6)+91;\n  \n  else if(pt[i]\u0026gt;=123 \u0026amp;\u0026amp; pt[i]\u0026lt;=126)\n  ct[i]=(((pt[i]-123)+key[i])%4)+123;\n  \n  \/\/ For space \n  else if(pt[i]==' ')\n  ct[i]=pt[i]+127+key[i]; \n}\n    \n \n printf(\"\\nEncrypted data: \");\n for(i=0;i\u0026lt;l;i++)\n {\n  printf(\"%c\",ct[i]);\n }\n \n \/\/ Decrypting\n for(i=0;i\u0026lt;l;i++)\n {\n  \/\/ For small letter\n  if(ct[i]\u0026gt;=97 \u0026amp;\u0026amp; ct[i]\u0026lt;=122)\n  {\n   if((((ct[i]-97)-key[i])%26)\u0026lt;0)\n   pt[i]=ct[i]-key[i]+26;\n   else\n    pt[i]=(((ct[i]-97)-key[i])%26)+97; \n  }\n  \n  \/\/ For capital letter\n  else if(ct[i]\u0026gt;=65 \u0026amp;\u0026amp; pt[i]\u0026lt;=90)\n  {\n   if((((ct[i]-65)-key[i])%26)\u0026lt;0)\n   pt[i]=ct[i]-key[i]+26;\n   else\n    pt[i]=(((ct[i]-65)-key[i])%26)+65; \n  }\n  \n  \/\/ For digits\n  else if(ct[i]\u0026gt;=48 \u0026amp;\u0026amp; pt[i]\u0026lt;=57)\n  {\n   if((((ct[i]-48)-key[i])%10)\u0026lt;0)\n   pt[i]=ct[i]-key[i]+10;\n   else\n    pt[i]=(((ct[i]-48)-key[i])%10)+48; \n \n      }\n      \n  \/\/ For special character\n  else if(ct[i]\u0026gt;=33 \u0026amp;\u0026amp; pt[i]\u0026lt;=47)\n  {\n   if((((ct[i]-33)-key[i])%15)\u0026lt;0)\n   pt[i]=ct[i]-key[i]+15;\n   else\n    pt[i]=(((ct[i]-33)-key[i])%15)+33; \n \n  }\n  \n   else if(ct[i]\u0026gt;=58 \u0026amp;\u0026amp; pt[i]\u0026lt;=64)\n  {\n   if((((ct[i]-58)-key[i])%7)\u0026lt;0)\n   pt[i]=ct[i]-key[i]+7;\n   else\n    pt[i]=(((ct[i]-58)-key[i])%7)+58; \n  }\n  \n   else if(ct[i]\u0026gt;=91 \u0026amp;\u0026amp; pt[i]\u0026lt;=96)\n  {\n   if((((ct[i]-91)-key[i])%6)\u0026lt;0)\n   pt[i]=ct[i]-key[i]+6;\n   else\n    pt[i]=(((ct[i]-91)-key[i])%6)+91; \n  }\n  \n   else if(ct[i]\u0026gt;=123 \u0026amp;\u0026amp; pt[i]\u0026lt;=126)\n  {\n   if((((ct[i]-123)-key[i])%4)\u0026lt;0)\n   pt[i]=ct[i]-key[i]+4;\n   else\n    pt[i]=(((ct[i]-123)-key[i])%4)+123; \n  }\n  \n  \/\/ For space\n  else\n  pt[i]=ct[i]-127-key[i];\n  \n }\n \n printf(\"\\nActual Data: \");\n for(i=0;i\u0026lt;l;i++)\n {\n  printf(\"%c\",pt[i]);\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"},"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":"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-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":"C Programs"},{"scheme":"http://www.blogger.com/atom/ns#","term":"control sturctures"}],"title":{"type":"text","$t":"C PROGRAMS : CONTROL STRUCTURES"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003EC PROGRAMS : CONTROL STRUCTURES\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures4.html#21\" name=\"21\"\u003E21.Program to award Grades according to the following: \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\u003Cpre\u003E\u003Cspan style=\"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=\"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 for marks\n int m1,m2,m3,m4,m5;\n \n \/\/ Declaring variable for p=percentage\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=(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;=50 \u0026amp;\u0026amp; p\u0026lt;=59)\n printf(\"Grade D\");\n else if(p\u0026gt;=60 \u0026amp;\u0026amp; p\u0026lt;=69)\n printf(\"Grade C\");\n else if(p\u0026gt;=70 \u0026amp;\u0026amp; p\u0026lt;=79)\n printf(\"Grade B\");\n else\n printf(\"Grade A\");\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\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures4.html#22\" name=\"22\"\u003E22.Grade Program without using if-else statement \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\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 \/\/ Declaring variable for marks\n int m1,m2,m3,m4,m5;\n \n \/\/ Declaring variable for p=percentage\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=(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;=50 \u0026amp;\u0026amp; p\u0026lt;=59)\n {\n  printf(\"Grade D\");\n  break;\n }\n while(p\u0026gt;=60 \u0026amp;\u0026amp; p\u0026lt;=69)\n {\n  printf(\"Grade C\");\n  break;\n }\n while(p\u0026gt;=70 \u0026amp;\u0026amp; p\u0026lt;=79)\n {\n  printf(\"Grade B\");\n  break;\n }\n while(p\u0026gt;=80)\n {\n  printf(\"Grade A\");\n  break;\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\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures4.html#23\" name=\"23\"\u003E23.Program to calculate the sum of individual digits of a number \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\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 \/\/ Declaring variable for n=number, d=digit\n int n, d, sum=0;\n \n \/\/ Inputing number\n printf(\"Enter number: \");\n scanf(\"%d\",\u0026amp;n);\n \n \/\/ Determing sum of digits\n while(n!=0)\n {\n  d=n%10;  \/\/ Extracting last digit of a number\n  sum=sum+d; \/\/ Calculating digit sum\n  n=n\/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=\"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\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures4.html#24\" name=\"24\"\u003E24.Program to determine whether a given year is leap year or not \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\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 \/\/ Declaring variable for y=year\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==0)\n {\n  if(y%100==0 \u0026amp;\u0026amp; y%400!=0)\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=\"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\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":"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-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":"C Programs"},{"scheme":"http://www.blogger.com/atom/ns#","term":"control sturctures"}],"title":{"type":"text","$t":"C PROGRAMS : CONTROL STRUCTURES"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003EC PROGRAMS : CONTROL STRUCTURES\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures3.html#p16\" name=\"p16\"\u003E17.Program to print the fibonacii series till which user wishes \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\u003Cpre\u003E\u003Cspan style=\"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=\"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 for n=number, f=first, s=second, \n  t=third number, i=to 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=0;\n  s=1;\n  printf(\"%d %d \",f,s);\n  for(i=3;i\u0026lt;=n;i++)\n  {\n   t=f+s;\n   printf(\"%d \",t);\n   f=s;\n   s=t;\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\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures3.html#p17\" name=\"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=\"mokcode\"\u003E\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 \/\/ Declaring variable for c=character\n char c;\n \n \/\/ Inputing character\n printf(\"Enter any character: \");\n scanf(\"%c\",\u0026amp;c);\n \n if(c\u0026gt;=65 \u0026amp;\u0026amp; c\u0026lt;=90)\n printf(\"Character is Upper Case Letter\");\n else if(c\u0026gt;=97 \u0026amp;\u0026amp; c\u0026lt;=122)\n printf(\"Character is Lower Case Letter\");\n else if(c\u0026gt;=48 \u0026amp;\u0026amp; c\u0026lt;=57)\n printf(\"Character is a Digit\");\n else\n printf(\"Character is Special Symbol\");\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\u003C\/pre\u003E\u003C\/div\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures3.html#p18\" name=\"p18\"\u003E18.Program to find whether a number is Perfect Square or Not \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\u003Cpre\u003E\u003Cspan style=\"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=\"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 for n=number\n int n;\n \n \/\/ Declaring variable for r=remainder, q=uotient, i=to iterate the loop\n int r=0,q=0,i,flag=0;\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=1;i\u0026lt;=n;i++)\n {\n  r=n%i;\n  q=n\/i;\n  if(r==0 \u0026amp;\u0026amp; i==q)\n  {\n   flag=1;\n   break;\n  }\n }\n \n \/\/ Displaying Result\n if(flag==1)\n printf(\"Number is Perfect Square\");\n else\n printf(\"Number is not Perfect Square\");\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\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures3.html#p19\" name=\"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=\"mokcode\"\u003E\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 \/* Declaring variable for r=remainder, q=uotient, i,\n m=to iterate the loops, f1=Another flag variable *\/\n int r=0, q=0, i, flag=0, f1=0, m;\n \n \/\/ Delcaring variable for s=start point, e=endpoint\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=s;m\u0026lt;=e;m++)\n {\n  flag=0;\n for(i=1;i\u0026lt;=m;i++)\n {\n  r=m%i;\n  q=m\/i;\n  if(r==0 \u0026amp;\u0026amp; i==q)\n  {\n   f1=1;\n   flag=1;\n   break;\n  }\n }\n \n \/\/ Displaying Perfect Square Numbre in the given format\n if(flag==1)\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==0)\n printf(\"No Perfect Square Number exist\");\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\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures3.html#p20\" name=\"p20\"\u003E20. Program for Bank account Handling \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\u003Cpre style=\"text-align: left;\"\u003E\u003Cspan style=\"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 = 1000\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 for a=amount, ba=balance amount, si=simple interest\n float a, ba=1000, si;\n \n \/* Declaring variable for ch=choice, d=day, ans=checks 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=ba+a;\n   break;\n  case 2:\n   \/\/ Inputing withdrawl amount\n   printf(\"Enter withdrawl amount:\");\n   scanf(\"%f\",\u0026amp;a);\n   ba=ba-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=(a*0.04*d)\/100;\n   printf(\"Simple interest=%f\\n\",si);\n   ba=ba+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==1);\n \n printf(\"Press any key to exit\");\n\u0026nbsp;\u003C\/span\u003E\u003C\/pre\u003E\u003Cpre style=\"text-align: left;\"\u003E\u003Cspan style=\"color: blue;\"\u003E 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\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":"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-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":"C Programs"},{"scheme":"http://www.blogger.com/atom/ns#","term":"control sturctures"}],"title":{"type":"text","$t":"C PROGRAMS : CONTROL STRUCTURES"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003EC PROGRAMS : CONTROL STRUCTURES\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures2.html#p11\" name=\"p11\"\u003E11.Program to find whether a given number is Prime or Not \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\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 \/* Declaring variable for n=number, c=counter variable:holds \n number of factor of 'n' *\/\n int n,c=0, 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=1;i\u0026lt;=n;i++)\n {\n  if(n%i==0)\n  c=c+1;\n }\n \n if(c==2)\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=\"color: blue;\"\u003E\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\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures2.html#p12\" name=\"p12\"\u003E12.Program to print ( list ) all the prime number between 1 to n \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\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 \/* Declaring variable for n=number, c=counter 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=1;i\u0026lt;=n;i++)\n {\n  c=0;\n  for(j=1;j\u0026lt;=i;j++)\n  {\n  if(i%j==0)\n  c=c+1;\n  }\n if(c==2)\n printf(\"%d \",i);\n }\n \n }\n else \n printf(\"Not a valid Number\");\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\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures2.html#p13\" name=\"p13\"\u003E13.Program to print (list) Palindrome number from 10 to n\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Palindrome Number: Reverse of Number = Number\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 for num=user wish, i=acts as number, n=to copy number, \nd=digit, rev=reverse of number *\/\nint num,n,d=0,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=10;i\u0026lt;=num;i++)\n{\n \/\/ copying number in n\n n=i;\n rev=0;\n\/\/ Determining whether number is palindrome or not\nwhile(n!=0)\n{\n           d=n%10;\n           rev=rev*10+d;\n           n=n\/10;\n           }\n           \n           \/\/ Displaying Whether number is palindrome or not\n           if(i==rev)\n           printf(\"%d \",i);\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     \n     }\u003C\/span\u003E\n\u003C\/pre\u003E\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures2.html#p14\" name=\"p11\"\u003E14.Program to print (list) Armstrong Number between two given numbers \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Armstrong Number: Sum of cube of digit=Number\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 for s=start point, e=end point, i=acts as number, \nn=to copy number, d=digit, s=sum *\/\nint s,e,n,d=0,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=s;i\u0026lt;=e;i++)\n{\n \/\/ copying number in n\n n=i;\n sum=0;\n \n\/\/ Determining whether number is pallindrome or not\nwhile(n!=0)\n{\n           d=n%10;\n           sum=sum+(d*d*d);\n           n=n\/10;\n }\n           \n           \/\/ Displaying Whether number is pallindrome or not\n           if(i==sum)\n           printf(\"%d \",i);\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     \n}\u003C\/span\u003E\u003C\/pre\u003E\u003C\/div\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures2.html#p15\" name=\"p11\"\u003E15.Program to print the factor of a given number \u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\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 \/\/ Declaring variable for n=numbre,i=to 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=1;i\u0026lt;=n;i++)\n {\n  if(n%i==0)\n  printf(\"%d \",i);\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\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":"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-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":"C Programs"},{"scheme":"http://www.blogger.com/atom/ns#","term":"control sturctures"}],"title":{"type":"text","$t":"C PROGRAMS : CONTROL STUCTURES"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003EC PROGRAMS : CONTROL STRUCTURES\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures1.html#p6\" name=\"p6\"\u003E6. Program for finding the factorial of a number\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;stdio.h\u0026gt;\u003C\/span\u003E\u003C\/pre\u003E\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;conio.h\u0026gt; \u003C\/span\u003E\u003Cspan style=\"color: blue;\"\u003E\/\/ Linux user - Remove this\u003C\/span\u003E\u003C\/pre\u003E\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E\nint main()\n{\n\n\/\/ Variable for n=number and fact=factorial\nint n,fact=1;\n\n\/\/ Inputing number whose factorial is to be found\nprintf(\"Enter number:\");\nscanf(\"%d\",\u0026amp;n);\n\n\/\/ Calculating Factorial\nwhile(n\u0026gt;=1)\n{\nfact=fact*n;\nn--;\n}\n\n\/\/ Diaplaying Factorial\nprintf(\"%d\",fact);\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\u003C\/pre\u003E\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures1.html#p7\" name=\"p7\"\u003E7. Program to find whether the entered character is vowel or not using if else\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;stdio.h\u0026gt;\u003C\/span\u003E\u003Cstdio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\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\u003Cconio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\nint main()\n{\n \/\/ Declaring variable where c=character\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=='a' || c=='e' || c=='i' || c=='o' || c=='u' || c=='A' || \n c=='E' || c=='I' || c=='O' || c=='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=\"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\/conio\u003E\u003C\/stdio\u003E\u003C\/pre\u003E\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures1.html#p8\" name=\"p8\"\u003E8. Program to find whether the entered character is vowel or not using switch case\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;stdio.h\u0026gt;\u003C\/span\u003E\u003Cstdio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\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\u003Cconio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\nint main()\n{\n \/\/ Declaring variable where c=character\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=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures1.html#p9\" name=\"p9\"\u003E9. Program to print the table of a given number till the user wishes\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;stdio.h\u0026gt;\u003C\/span\u003E\u003Cstdio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\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\u003Cconio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\nint main()\n{\n \/\/ Declaring Variable for n=number, tw=till 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=1;i\u0026lt;=tw;i++)\n {\n printf(\"%d * %d = %d \\n\",n,i,n*i);\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\/conio\u003E\u003C\/stdio\u003E\u003C\/pre\u003E\u003C\/div\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures1.html#p10\" name=\"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=\"mokcode\"\u003E\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;stdio.h\u0026gt;\u003C\/span\u003E\u003Cstdio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\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\u003Cconio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\nint main()\n{\n \/\/ Declaring variable for n=number, s=sum\n int n,s=0;\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=s+n;\n }while(n!=0);\n \n \/\/ Displaying sum of all integers entered\n printf(\"Sum of all integers=%d\",s);\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\/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":"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-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":"C Programs"},{"scheme":"http://www.blogger.com/atom/ns#","term":"control sturctures"}],"title":{"type":"text","$t":"C PROGRAMS : CONTROL STRUCTURES"},"content":{"type":"html","$t":"\u003Cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003EC PROGRAMS : CONTROL STRUCTURES\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures.html#p1\" name=\"p1\"\u003E1. Program to multiply 2 number without using * operator\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;stdio.h\u0026gt;\u003C\/span\u003E\u003Cstdio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\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\u003Cconio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\nint main()\n{\n \/\/ Variable for 2 numbers, and for result\n int a, b, r=0;\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=r+a;\n  b--;\n }\n }\n else\n {\n while(a)\n {\n  r=r+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=\"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\/conio\u003E\u003C\/stdio\u003E\u003C\/pre\u003E\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures.html#p2\" name=\"p2\"\u003E2. Program to determine armstrong number\u003C\/a\u003E\u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;stdio.h\u0026gt;\u003C\/span\u003E\u003Cstdio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\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\u003Cconio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\nint main()\n{\n\/\/ variable for a=numbern, n=to copy number, d=digit\nint a,n,d=0,sum=0;\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=a;\n\n\/\/ Determining whether number is armstrong or not\nwhile(n!=0)\n{\n           d=n%10;\n           sum=sum+d*d*d;\n           n=n\/10;\n}\n           \n\/\/ Displaying Whether number is armstrong or not\nif(a==sum)\nprintf(\"Armstron no\");\nelse\nprintf(\"not armstrong\");\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\/conio\u003E\u003C\/stdio\u003E\u003C\/pre\u003E\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures.html#p3\" name=\"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=\"mokcode\"\u003E\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 \/* Variable for time in second, converted in hour, converted in minutes \n and converted in seconds, r for remainder *\/\n int ts, ch=0, cm=0, cs, r=0;\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=ts;\n \n else if(ts\u0026lt;3600)\n {\n cm=ts\/60;\n cs=ts%60; \n }\n \n else if(ts\u0026gt;3600)\n {\n ch=ts\/3600;\n r=ts%3600;\n if(r\u0026gt;60)\n {\n  cm=r\/60;\n  r=r%60;\n }\n if(r\u0026lt;60)\n cs=r;\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=\"color: blue;\"\u003E 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 \n}\u003C\/span\u003E\n\u003C\/pre\u003E\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures.html#p4\" name=\"p41\"\u003E4. Program to determine palindrome number\u003C\/a\u003E \u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;stdio.h\u0026gt;\u003C\/span\u003E\u003Cstdio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\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\u003Cconio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\nint main()\n{\n\/\/ variable for a=number, n=to copy number, d=digit, rev=reverse of number\nint a,n,d=0,rev=0;\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=a;\n\n\/\/ Determining whether number is palindrome or not\nwhile(n!=0)\n{\n           d=n%10;\n           rev=rev*10+d;\n           n=n\/10;\n           }\n           \n           \/\/ Displaying Whether number is palindrome or not\n           if(a==rev)\n           printf(\"Palindrome number\");\n           else\n           printf(\"Not a Palindrome Number\");\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     \n     }\u003C\/span\u003E\n\u003C\/conio\u003E\u003C\/stdio\u003E\u003C\/pre\u003E\u003C\/div\u003E\u003Ca href=\"http:\/\/www.comp-psyche.com\/2014\/01\/c-programs-control-structures.html#p5\" name=\"p5\"\u003E5. Program showing the use of goto statement\u003C\/a\u003E \u003Cbr \/\u003E\n\u003Cdiv class=\"mokcode\"\u003E\u003Cpre\u003E\u003Cspan style=\"color: blue;\"\u003E#include\u0026lt;stdio.\u0026gt;\u003C\/span\u003E\u003Cstdio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\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\u003Cconio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003E\nint main()\n{\nint i=0;\u003C\/span\u003E\u003C\/conio\u003E\u003C\/stdio\u003E\u003C\/pre\u003E\u003Cpre\u003E\u003Cstdio .h=\"\"\u003E\u003Cconio .h=\"\"\u003E\u003Cspan style=\"color: blue;\"\u003Egoto a;\nna:       \nprintf(\"Not allowed = %d\\n\",i);\na:\n    for(i=i+1;i\u0026lt;=35;i++)\n    {\n        if(i==15||i==30)\n        goto na;\n        else\n        printf(\"Allowed =%d\\n\",i);\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     \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":"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":"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=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003E\u003Ctitle\u003ECOMMON PROGRAMMING ERRORS - CONTROL STRUCTURES\u003C\/title\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"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=\"mokcode\"\u003E\u003Cspan style=\"color: blue;\"\u003Efor ( a = 4; a \u0026lt;= 10; a++);\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E{\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E\u0026nbsp; \u0026nbsp;printf ( \"%d\", a );\u003C\/span\u003E\u003Cbr \/\u003E\n\u003Cspan style=\"color: blue;\"\u003E}\u003C\/span\u003E\u003C\/div\u003E\u003Cbr \/\u003E\n\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\u0026nbsp; \u0026nbsp; 3. \u0026nbsp; Not including curly braces to include if or loop statements.\u003C\/div\u003E\u003Cdiv style=\"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=\"text-align: justify;\"\u003E\u0026nbsp; \u003Cbr \/\u003E\n\u003Cdiv\u003E\u003Cdiv\u003E\u003Cspan style=\"color: yellow;\"\u003EMore Informative Posts:\u003C\/span\u003E\u003C\/div\u003E\u003Cdiv\u003E\u003Cul\u003E\u003Cli\u003E\u003Cspan style=\"color: yellow;\"\u003E\u003Ca href=\"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=\"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=\"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=\"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":"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"}}]}});