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/-/List+of+C+Programs?alt\u003djson-in-script\u0026max-results\u003d50"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/-/List+of+C+Programs?alt\u003djson-in-script\u0026max-results\u003d50"},{"rel":"alternate","type":"text/html","href":"http://www.comp-psyche.com/search/label/List%20of%20C%20Programs"},{"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":"6"},"openSearch$startIndex":{"$t":"1"},"openSearch$itemsPerPage":{"$t":"50"},"entry":[{"id":{"$t":"tag:blogger.com,1999:blog-8285804830535272268.post-7058900845162201879"},"published":{"$t":"2015-06-01T10:06:00.000-07:00"},"updated":{"$t":"2016-11-18T11:27:57.073-08:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"List of C Programs"}],"title":{"type":"text","$t":"Prime Number Program In C"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\nProgram to find whether a given number is Prime or Not\u003c/h2\u003e\n\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\n\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\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\n\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n return 0;\n}\u003c/span\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\nProgram to print ( list ) all the prime number between 1 to n\u003c/h2\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\n\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\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\");\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\n\u003c/div\u003e\n\u003c/div\u003e\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/7058900845162201879/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2015/06/prime-number-program-in-c.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/7058900845162201879"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/7058900845162201879"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2015/06/prime-number-program-in-c.html","title":"Prime Number Program In C"}],"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-6161774581865760134"},"published":{"$t":"2015-05-25T13:35:00.000-07:00"},"updated":{"$t":"2015-05-25T13:38:47.946-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"List of C Programs"}],"title":{"type":"text","$t":"Palindrome Program In C"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\u003ch2 style\u003d\"text-align: left;\"\u003e\u003cspan style\u003d\"font-weight: normal;\"\u003e\u003cspan style\u003d\"color: yellow;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#Palindrome Program\" name\u003d\"Palindrome Program\"\u003ePalindrome Program\u003c/a\u003e\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\u003cbr /\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#Palindrome Number\"\u003eC Program to determine Palindrome number\u003c/a\u003e\u003c/li\u003e\u003cbr /\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#List Palindrome Number\"\u003eC Program to print (list) Palindrome number from 10 to n\u003c/a\u003e\u003c/li\u003e\u003cbr /\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#Recursion Palindrome Number\"\u003eC Program to find whether a number is Palindrome or not using recursion\u003c/a\u003e\u003c/li\u003e\u003cbr /\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#String Palindrome\"\u003eC Program to enter a word and check whether it is palindrome or not using string function\u003c/a\u003e\u003c/li\u003e\u003cbr /\u003e\n\u003cli style\u003d\"text-align: justify;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#String Palindrome1\"\u003eC Program to enter a word and check whether it is palindrome or not without using string function\u003c/a\u003e\u003c/li\u003e\u003cbr /\u003e\n\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#Palindrome Number\" name\u003d\"Palindrome Number\"\u003eC PROGRAM TO DETERMINE PALINDROME NUMBER\u003c/a\u003e\u003cbr /\u003e\n\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#Palindrome Program\"\u003eBack To Palindrome Program\u003c/a\u003e\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\nint main()\n{\n  // variable for a\u003dnumber, n\u003dto copy number, d\u003ddigit, rev\u003dreverse of number\n  int a,n,d\u003d0,rev\u003d0;\n\n  // Inputting number\n  printf(\"Enter any number to determine whether it is Palindrome or not:\");\n  scanf(\"%d\",\u0026amp;a);\n\n  // copying number in n\n  n\u003da;\n\n  // Determining whether number is palindrome or not\n  while(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  return 0;\n}\n\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\u003cspan style\u003d\"color: blue;\"\u003e\u003c/span\u003e\u003cbr /\u003e\n\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#List Palindrome Number\" name\u003d\"List Palindrome Number\"\u003eC PROGRAM TO PRINT(LIST) PALINDROME NUMBER FROM 10 TO n\u003c/a\u003e\u003cbr /\u003e\n\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#Palindrome Program\"\u003eBack To Palindrome Program\u003c/a\u003e\u003cbr /\u003e\n\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;\"\u003eint main()\n{\n  /*declaring variable for num\u003duser wish, i\u003dacts as number, n\u003dto copy number, \n  d\u003ddigit, rev\u003dreverse of number */\n  int num,n,d\u003d0,rev,i;\n\n  // Inputting number\n  printf(\"Enter number till which you want to list Palindrome Number:\");\n  scanf(\"%d\",\u0026amp;num);\n\n  printf(\"List of Palindrome Number:\");\n  for(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\n    while(n!\u003d0)\n    {\n       d\u003dn%10;\n       rev\u003drev*10+d;\n       n\u003dn/10\u003c/span\u003e\u003c/pre\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e    }\n           \n    // Displaying Whether number is palindrome or not\n    if(i\u003d\u003drev)\n    printf(\"%d \",i);\n  }\n\n  return 0;\u003c/span\u003e\u003c/pre\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e}\u003c/span\u003e\n\u003c/pre\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#Recursion Palindrome Number\" name\u003d\"Recursion Palindrome Number\"\u003eC PROGRAM TO FIND WHETHER A NUMBER IS PALINDROME OR NOT USING RECURSION\u003c/a\u003e\u003cbr /\u003e\n\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#Palindrome Program\"\u003eBack To Palindrome Program\u003c/a\u003e\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\n// Declaring global variable r\u003dreverse, d\u003ddigit\nint r\u003d0, d\u003d0;\n\n// Defining function with parameter n \u003d number\nint rev(int n)\n{\n/* Base condition : Any condition where a recursive function \nor method does not invoke itself. */\nif(n\u003d\u003d0)\nreturn r;\n\n// Continue calling function rev or function invoke itself\nelse\n{\n // Extracting digit\n d\u003dn%10;\n \n // Finding reverse\n r\u003d(r*10+d);\n \n // function invoke itself\n rev(n/10);\n}\n}\n\nint main()\n{\n// Declaring variable n \u003d number\nint n;\n\n// Declaring variable \"r\" to hold the reverse number\nint r;\n\n// Inputting Number\nprintf(\"Enter the Number : \");\nscanf(\"%d\",\u0026amp;n);\n\n// Calling function \"rev\" with actual parameter \"n\" passed to it\nr\u003drev(n);\n\n// Checking and Displaying if a Number is palindrome or Not\nif(r\u003d\u003dn)\nprintf(\"%d is a Palindrome Number \",n);\n\nelse\n printf(\"%d is not a Palindrome Number \",n);\u003c/span\u003e\u003c/pre\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nreturn 0;\n}\u003c/span\u003e\n\u003c/pre\u003e\u003cdiv\u003e\u003cspan style\u003d\"color: blue;\"\u003e\u003cbr /\u003e\n\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#String Palindrome\" name\u003d\"String Palindrome\"\u003eC PROGRAM TO ENTER A WORD AND CHECK WHETHER IT IS PALINDROME OR NOT USING STRING FUNCTION\u003c/a\u003e\u003cbr /\u003e\n\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#Palindrome Program\"\u003eBack To Palindrome Program\u003c/a\u003e\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e// palindrom - When word \u003d reverse of word then it is called palindrome\n// Example : madam - palindrome, Madam - not palindrome, MadaM - palindrome\n\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;string.h\u0026gt;\n\nint main()\n{\n // Declaring variable str\u003dstring \n char word[50], word1[50];\n \n // Inputing string\n printf(\"Enter any word : \");\n scanf(\"%s\",\u0026amp;word);\n\n // Copying word to word1\n strcpy(word1,word);\n \n // checking if palindrome or not\n if(strcmp(word,strrev(word1))\u003d\u003d0)\n {\n  printf(\"Entered word is a palindrome \");\n }\n \n else\n  printf(\"Entered word is not palindrome \");\n\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/2015/05/palindrome-program-in-c.html#String Palindrome1\" name\u003d\"String Palindrome1\"\u003ePALINDROME PROGRAM IN C WITHOUT USING STRING FUNCTION\u003c/a\u003e\u003cbr /\u003e\n\u003cbr /\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#Palindrome Program\"\u003eBack To Palindrome Program\u003c/a\u003e\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\n\nint main()\n{\n // Declaring variable str\u003dstring \n char word[50], revword[50];\n \n /* Declaring variable i\u003dto iterate loop, l\u003dlength, \n c\u003dcount the number of matched character */\n int i, j, l\u003d0, c;\n \n // Inputing string\n printf(\"Enter any word : \");\n scanf(\"%s\",\u0026amp;word);\n\n // finding length\n while(word[l]!\u003d'\\0')\n l++;\n \n // Reversing string\n j\u003d0;\n for(i\u003dl-1;i\u0026gt;\u003d0;i--)\n {\n  revword[j]\u003dword[i];\n  j++;\n }\n revword[j]\u003d'\\0';\n \n //checking if palindrome or not\n c\u003d0;\n for(i\u003d0;word[i]!\u003d'\\0';i++)\n {\n  if(revword[i]\u003d\u003dword[i])\n  c++;\n }\n \n if(c\u003d\u003dl)\n {\n  printf(\"Word is a palindrome \");\n }\n \n else\n  printf(\"Word is not palindrome \");\n \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/6161774581865760134/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2015/05/palindrome-program-in-c.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/6161774581865760134"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/6161774581865760134"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2015/05/palindrome-program-in-c.html","title":"Palindrome Program In C"}],"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-137593127550370753"},"published":{"$t":"2015-05-24T05:37:00.000-07:00"},"updated":{"$t":"2015-05-24T06:48:30.259-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"List of C Programs"}],"title":{"type":"text","$t":"Leap Year Program In C"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003ch3 style\u003d\"text-align: left;\"\u003e\n\u003cspan style\u003d\"font-weight: normal;\"\u003eLeap Year Program In C using if-else\u003c/span\u003e\u003c/h3\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\n\u003cspan style\u003d\"color: blue;\"\u003e// Leap year program in c using if-else\u003c/span\u003e\u003cbr /\u003e\n\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\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\");\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\u003cbr /\u003e\n\u003ch3 style\u003d\"text-align: left;\"\u003e\n\u003cspan style\u003d\"font-weight: normal;\"\u003eLeap Year Program In C Using Ternary\u003c/span\u003e\u003c/h3\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\n\u003cspan style\u003d\"color: blue;\"\u003e// Leap year program in c using ternary\u003c/span\u003e\u003cbr /\u003e\n\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\u003c/span\u003e\u003cstdio .h\u003d\"\"\u003e\u003cconio .h\u003d\"\"\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n\nint main()\n{\n // Declaring variable \"y\" to input year and \"leap\" to determine leap year\n int y,leap;\n \n // Inputting year\n printf(\"Enter any year : \");\n scanf(\"%d\",\u0026amp;y);\n \n // Checking if leaf year or not\n leap\u003d(y%400\u003d\u003d0)?:(y%100!\u003d0)?(y%4\u003d\u003d0)?1:0:0;\n\n if(leap\u003d\u003d1)\n printf(\"The given year is leap year\");\n else\n printf(\"The given year is not leap year\");\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\n\u003c/div\u003e\n\u003c/div\u003e\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/137593127550370753/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2015/05/leap-year-program-in-c.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/137593127550370753"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/137593127550370753"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2015/05/leap-year-program-in-c.html","title":"Leap Year Program In C"}],"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-5190126149427732341"},"published":{"$t":"2014-04-07T12:10:00.000-07:00"},"updated":{"$t":"2014-09-26T06:37:53.754-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"List of C Programs"}],"title":{"type":"text","$t":"C PROGRAM TO FIND FIBONACCI SERIES"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\n\u003cspan style\u003d\"font-weight: normal;\"\u003e\u003cspan style\u003d\"color: yellow;\"\u003eWHAT IS FIBONACCI SERIES\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cspan style\u003d\"color: yellow; text-align: justify;\"\u003eFibonacci series :\u003c/span\u003e\u003cspan style\u003d\"color: lime; text-align: justify;\"\u003e Fibonacci series\u003c/span\u003e\u003cspan style\u003d\"text-align: justify;\"\u003e is one in which the nth term is sum of (n-1)th term and (n-2)th term. The first two numbers of series are 0 and 1.\u003c/span\u003e\u003cbr /\u003e\nFor example: \u003cspan style\u003d\"color: lime;\"\u003e0 1 1 2 3 5 8 13 21\u003c/span\u003e and so on\u003cbr /\u003e\n\u003cbr /\u003e\nNow we can write a c program to find \u003cspan style\u003d\"color: lime;\"\u003efibonacci series \u003c/span\u003ein the following ways :\u003cbr /\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/04/write-c-program-to-find-fibonacci-series.html#C Program to find fibonacci series using loops\"\u003eC Program to find fibonacci series using loops\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/04/write-c-program-to-find-fibonacci-series.html#C Program to find fibonacci series using function\"\u003eC Program to find fibonacci series using function\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/04/write-c-program-to-find-fibonacci-series.html#C Program to find fibonacci series using recursion\"\u003eC Program to find fibonacci series using recursion\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2\u003e\n\u003cspan style\u003d\"font-weight: normal;\"\u003eC\u0026nbsp;\u003ca href\u003d\"http://www.comp-psyche.com/2014/04/write-c-program-to-find-fibonacci-series.html#C Program to find fibonacci series using loops\" name\u003d\"C Program to find fibonacci series using loops\"\u003ePROGRAM TO FIND FIBONACCI SERIES USING LOOPS\u003c/a\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\n\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e//\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003eC PROGRAM TO PRINT FIBONACCI SERIES\u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e USING LOOPS\u003c/span\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e \n #include\u0026lt;stdio.h\u0026gt;\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 printed\n  printf(\"Enter the number till which you want to print fibonacci series:\");\n  scanf(\"%d\",\u0026amp;n);\n  \n  // Determining and printing fibonacii series\n  printf(\"Fibonacci 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  \u003c/span\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n  return 0;\n }\u003c/span\u003e\n\u003c/pre\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: blue;\"\u003e\u003cbr /\u003e\n\u003c/span\u003e\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003ch2\u003e\n\u003cspan style\u003d\"font-weight: normal;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/04/write-c-program-to-find-fibonacci-series.html#C%20Program%20to%20find%20fibonacci%20series%20using%20function\" name\u003d\"C Program to find fibonacci series using function\"\u003eC PROGRAM TO FIND FIBONACCI SERIES USING FUNCTION\u003c/a\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003c/div\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\n\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e//C PROGRAM TO FIND FIBONACCI SERIES USING FUNCTION\u003c/span\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e#include\u0026lt;stdio.h\u0026gt;\n\nvoid fibonacci(int n);\nint main()\n{\u003c/span\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e  int n;\u003c/span\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e\n  // Inputing number till where fibonacci series is to be printed\n  printf(\"Enter the number till which you want to print fibonacci series:\");\n  scanf(\"%d\",\u0026amp;n);\n  \n  fibonacci(n);\n  return 0;\n}\u003c/span\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nvoid fibonacci(int n)\n{\n  /* Declaring variable for f\u003dfirst, s\u003dsecond, \n  t\u003dthird number, i\u003dto iterate the loop */\n  int f,s,t,i;\n  \n  // Determining and printing fibonacii series\n  printf(\"Fibonacci 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}\u003c/span\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\n\u003cspan style\u003d\"font-weight: normal;\"\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/04/write-c-program-to-find-fibonacci-series.html#C%20Program%20to%20find%20fibonacci%20series%20using%20recursion\" name\u003d\"C Program to find fibonacci series using recursion\"\u003eC PROGRAM TO FIND FIBONACCI SERIES USING RECURSION\u003c/a\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cdiv class\u003d\"mokcode\"\u003e\n\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e//WRITE A C PROGRAM TO FIND FIBONACCI SERIES USING RECURSION\n#include\u0026lt;stdio.h\u0026gt;\n\nint fibonacci(int n);\n\n  /* Declaring variable for f\u003dfirst, s\u003dsecond, \n  t\u003dthird number, i\u003dto iterate the loop */\n  int f,s,t,i;\n  f\u003d0;\n  s\u003d1;\n\nint main()\n{\n   int n;\n  // Inputing number till where fibonacci series is to be printed\n  printf(\"Enter the number till which you want to print fibonacci series:\");\n  scanf(\"%d\",\u0026amp;n);\n  \n  printf(\"Fibonacci Series: \");\n  printf(\"%d %d \",f,s);\n  \n  fibonacci(n);\n  return 0;\n}\u003c/span\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003cspan style\u003d\"color: blue;\"\u003e\nint fibonacci(int n)\n{\n if(n\u003d\u003d2)\n {\n    return 0;\n }\n \n else\n {\n    t\u003df+s;\n    printf(\"%d \",t);\n    f\u003ds;\n    s\u003dt;\n    fibonacci(n-1);\n }\n}\u003c/span\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\nNote : You can write much better code than these. So view these example and try to program by yourself. Use your own logic. This would improve your programming skills.\u003c/div\u003e\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/5190126149427732341/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2014/04/write-c-program-to-find-fibonacci-series.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/5190126149427732341"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/5190126149427732341"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2014/04/write-c-program-to-find-fibonacci-series.html","title":"C PROGRAM TO FIND FIBONACCI SERIES"}],"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-6623677954738708965"},"published":{"$t":"2014-04-06T06:17:00.001-07:00"},"updated":{"$t":"2015-05-24T05:45:48.195-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"List of C Programs"}],"title":{"type":"text","$t":"List Of C Programs"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\nHere I am providing with random list of c programs. For complete list of c programs you can visit :\u003ca href\u003d\"http://www.comp-psyche.com/2014/01/c-programs.html\" target\u003d\"_blank\"\u003e C PROGRAMS\u003c/a\u003e\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/03/write-a-c-program-to-reverse-a-string.html\" target\u003d\"_blank\"\u003eC Program to reverse a string using strerev and without using strrev, using pointers and recursion\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/04/write-c-program-to-find-fibonacci-series.html\" target\u003d\"_blank\"\u003eC Program to find fibonacci series using loops, function and recursion\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/09/c-program-to-add-subtract-multiply-diviide-two-numbers.html\"\u003eC Program to add, subtract, multiply and divide two numbers\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2015/05/leap-year-program-in-c.html\"\u003eLeap Year Program In C using if-else and ternary\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2015/02/pattern-programs-in-c.html\"\u003ePattern Programs In C\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/div\u003e\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/6623677954738708965/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2014/04/list-of-c-programs.html#comment-form","title":"0 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/6623677954738708965"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/6623677954738708965"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2014/04/list-of-c-programs.html","title":"List Of C Programs"}],"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-5404635783997042152"},"published":{"$t":"2014-03-27T11:44:00.000-07:00"},"updated":{"$t":"2017-09-16T06:34:28.860-07:00"},"category":[{"scheme":"http://www.blogger.com/atom/ns#","term":"List of C Programs"}],"title":{"type":"text","$t":"Reverse String In C / Reversing String In C"},"content":{"type":"html","$t":"\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003cdiv dir\u003d\"ltr\" style\u003d\"text-align: left;\" trbidi\u003d\"on\"\u003e\n\u003cb\u003eReversing string in C\u003c/b\u003e\u0026nbsp;\u003cb\u003e/ Reverse String In C \u003c/b\u003eseems to be a daunting task for the newbies but after reading this post you can easily \u003cb\u003ereverse string in C\u003c/b\u003e.\u003cbr /\u003e\n\u003cbr /\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\nWhat Is Reverse String In C\u003c/h2\u003e\nReverse string in c is basically taking input( i.e sentence ) from console and then display the sentence from last character to first character.\u003cbr /\u003e\n\u003cbr /\u003e\nThe following \u003cspan style\u003d\"color: lime;\"\u003eProgram\u003c/span\u003e to reverse string in c accepts a string from the user and print the \u003cspan style\u003d\"color: lime;\"\u003ereverse string\u003c/span\u003e. For example consider the following input from the user :\u003cbr /\u003e\n\u003cdiv\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: yellow;\"\u003eInput String :\u003c/span\u003e \u003cspan style\u003d\"color: lime;\"\u003eThe site name is comp-psyche.com\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cspan style\u003d\"color: yellow;\"\u003eOutput String \u003c/span\u003e\u003cspan style\u003d\"color: yellow;\"\u003e:\u003c/span\u003e \u003cspan style\u003d\"color: lime;\"\u003emoc.ehcysp-pmoc si eman etis ehT\u003c/span\u003e\u003cbr /\u003e\n\u003cspan style\u003d\"color: lime;\"\u003e\u003cbr /\u003e\n\u003c/span\u003e\u003c/div\u003e\n\u003cdiv\u003e\nThere are various ways to reverse string in c. You can either use string function to reverse string in c or you can reverse string in c without using c string function.\u003c/div\u003e\n\u003cdiv\u003e\n\u003cul style\u003d\"text-align: left;\"\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/03/write-a-c-program-to-reverse-a-string.html#Reverse String Using String Function\"\u003eReverse string in C using function ( c strrev() )\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/03/write-a-c-program-to-reverse-a-string.html#Reverse String Without Using String Function\"\u003eReverse String in C without using string function\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/03/write-a-c-program-to-reverse-a-string.html#C Program To Reverse String Using recursion\"\u003eReverse String in C using Recursion\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href\u003d\"http://www.comp-psyche.com/2014/03/write-a-c-program-to-reverse-a-string.html#C Program To Reverse String Using Pointer\"\u003eReverse String in C using Pointer\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv\u003e\n\u003cbr /\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/03/write-a-c-program-to-reverse-a-string.html#Reverse String Using String Function\" name\u003d\"Reverse String Using String Function\" style\u003d\"font-weight: normal;\"\u003eREVERSE STRING IN C USING STRING FUNCTION ( c strrev() )\u003c/a\u003e\u003c/h2\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\nIn the following program we will reverse string in c using string function streev()\u003c/div\u003e\n\u003cdiv\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\n\u003cpre class\u003d\"mokcode\"\u003e\u003ccode\u003e\n#include\u0026lt;stdio.h\u0026gt;\n#include\u0026lt;string.h\u0026gt;\n\nint main()\n{\n // Declaring variable str\u003dstring \n char str[50];\n \n // Inputing string\n printf(\"Enter any string : \");\n gets(str);\n\n // Printing string and reversed string\n printf(\"String : %s\\n\",str);\n printf(\"Reversed string : %s\",strrev(str));\n\n return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/03/write-a-c-program-to-reverse-a-string.html#Reverse String Without Using String Function\" name\u003d\"Reverse String Without Using String Function\" style\u003d\"font-weight: normal;\"\u003eREVERSE STRING IN C WITHOUT USING STRING FUNCTION\u003c/a\u003e\u003c/h2\u003e\n\u003cdiv\u003e\nIn the following program we will reverse string in c without using string function\u003c/div\u003e\n\u003cdiv\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cpre class\u003d\"mokcode\"\u003e\u003ccode\u003e\n\nint main()\n{\n // Declaring variable str\u003dstring, revstr[50]\u003dreverse string\n char str[50], revstr[50];\n \n // Declaring variable i\u003dto iterate loop, l\u003dlength\n int i, j,l\u003d0;\n \n // Inputing string\n printf(\"Enter any string : \");\n gets(str);\n\n // finding length\n while(str[l]!\u003d'\\0')\n l++;\n \n // Reversing string\n j\u003d0;\n for(i\u003dl-1;i\u0026gt;\u003d0;i--)\n {\n  revstr[j]\u003dstr[i];\n  j++;\n }\n revstr[j]\u003d'\\0';\n \n // Printing string and reversed string\n printf(\"String : %s\\n\",str);\n printf(\"Reversed string : %s\",revstr);\n\n}\u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/03/write-a-c-program-to-reverse-a-string.html#C Program To Reverse String Using recursion\" name\u003d\"C Program To Reverse String Using recursion\"\u003eREVERSE STRING IN C USING RECURSION\u003c/a\u003e\u003c/h2\u003e\n\u003cdiv\u003e\nIn the following program we will reverse string in c using recursion\u003c/div\u003e\n\u003cdiv\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cpre class\u003d\"mokcode\"\u003e\u003ccode\u003e\n// Write a c program to reverse a string using recursion\n#include\u0026lt;stdio.h\u0026gt;\nvoid reverse (int index, char *str );\n\nint main (void)\n\n{\n\n   char str[100];\n   printf (\"Enter any string : \"); \n   gets(str);\n reverse (strlen(str) , str );\n return 0;\n\n}\n\nvoid reverse (int index, char *str )\n\n{\n\n  if (--index \u0026lt; 0 )\n\n  {\n       return ;\n  }\n\n  else\n  {\n        putchar ( *(str + index) ) ;  \n        reverse (index, str) ;\n  }\n\n}\n\u003c/code\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\u003ch2 style\u003d\"text-align: left;\"\u003e\n\u003ca href\u003d\"http://www.comp-psyche.com/2014/03/write-a-c-program-to-reverse-a-string.html#C Program To Reverse String Using Pointer\" name\u003d\"C Program To Reverse String Using Pointer\"\u003eREVERSE STRING IN C USING POINTER\u003c/a\u003e\u003c/h2\u003e\n\u003cdiv\u003e\nIn the following program we will reverse string in c using pointer\u003c/div\u003e\n\u003cdiv\u003e\n\u003cbr /\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003cpre class\u003d\"mokcode\"\u003e\u003ccode\u003e// Write a C program to reverse a string using pointer\n#include\u0026lt;stdio.h\u0026gt;\nint main()\n{\n    \n    // Declaring variable str \u003d string and revstr \u003d to store the revere string\n    char str[50];\n    char revstr[50];\n    \n    char *strptr \u003d str; // strptr - holds the first position address of str\n    char *revptr \u003d revstr; // revptr - holds the first position address of revstr\n    int i\u003d-1;\n\n    // Inputting string\n    printf(\"Enter any string : \");\n    gets(str);\n   \n    // strptr is pointed to the last position address\n    while(*strptr)\n    {\n        strptr++;\n        i++;\n    }\n\n    // string stored in str is copied to revstr\n    while(i\u0026gt;\u003d0)\n{\n       strptr--;\n       *revptr \u003d *strptr;\n       revptr++;\n       --i;\n    }\n\n    *revptr\u003d'\\0';\n  \n    printf(\"Reverse of string is : %s\",revstr);\n  \n    return 0;\n}\n\u003c/code\u003e\u003c/pre\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\u003c/div\u003e\n"},"link":[{"rel":"replies","type":"application/atom+xml","href":"https://www.comp-psyche.com/feeds/5404635783997042152/comments/default","title":"Post Comments"},{"rel":"replies","type":"text/html","href":"https://www.comp-psyche.com/2014/03/write-a-c-program-to-reverse-a-string.html#comment-form","title":"3 Comments"},{"rel":"edit","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/5404635783997042152"},{"rel":"self","type":"application/atom+xml","href":"https://www.blogger.com/feeds/8285804830535272268/posts/default/5404635783997042152"},{"rel":"alternate","type":"text/html","href":"https://www.comp-psyche.com/2014/03/write-a-c-program-to-reverse-a-string.html","title":"Reverse String In C / Reversing String In C"}],"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":"3"}}]}});