C program Palindrome word | tutorial for c

What is c programming?

C programming is a general-purpose computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system.
Although C programming was designed for implementing system software,It is also widely used for developing portable application software.
C programming is one of the most popular programming languages of all time and there are very few computer architectures for which a C programming compiler does not exist. C has greatly influenced many other popular programming languages.tutorial for c,c examples source code,simple examples of c programs,simple c program examples

tutorial for c,c examples source code,simple examples of c programs,simple c program examples

Bellow is c program example for c programming practice

Bellow is c program example for c programming practice

C source codes for Palindrome word

/* ********************************************************************
      This program display palindrom word from string. If you give more then
      one space between word then it work same as when one space is given
      If this program not found any palindrom word it display non.

      author-Nikunj v Gandhi
      from-gujarat(surat)
      Web Developer(PHP ZCE)
      email-nik_gandhi007@yahoo.com
      http//my-source-codes.blogspot.com
      ******************************************************************** */
   #include<conio.h>
   #include<stdio.h>
   #include<string.h>
   void extractword(char[],int);
   void palincheck(char[]);
   void main()
      {
  int len;
  char str[120];
  clrscr();
  printf("Enter string?");
  gets(str);
  len=strlen(str);
  str[len]=' ';
  extractword(str,len);
       }
   void extractword(char str[],int l)
 {
    char substr[20];
    int i,j=0,p,m=0;
    for(i=0;i<=l;i++)
  {
    if(str[i]==32)
       m++;
       if(m==1)
         {
    substr[j]='\0';
    palincheck(substr);
    substr[0]='\0';
    j=0;
    m++;
         }
         else if(str[i]!=32)
     {
       m=0;
       substr[j]=str[i];
       j++;
  }
       }
       printf("\n\n");
       printf("***********************************************\n");
       printf("FOR MORE INFORMATION E-MAIL ME AT nik_gandhi007@yahoo.com");
       printf("\n");
       
       printf("**************************************************");
       getch();
  }
       void palincheck(char nik[])
    {
      int l,flag;
      int k=0;
      l=strlen(nik);
       if(l>1)
  {
    for(k=0;k<l;k++)
      {
       if(nik[k]==nik[l-k-1])
        flag=1;
       else
        {
         flag=0;
         break;
        }
   }
  if(flag==1)
    {
      printf("%s\n",nik);
      flag=0;
    }
        }
        nik[0]='\0';
   }


Buy Me a Beer-If you are like this post

 If you does not have paypal account create free account create account

No comments:

Post a Comment