C PRACTICAL / CHECK WHETHER THE GIVEN STRING IS PALINDROME OR NOT

hello friends....

TAKE THE FIRST STEP TO KNOWLEDGE FRIENDS BECAUSE KNOWLEDGE IS FREE.

>> /* WRITE A C PROGRAM TO CHECK WHETHER THE GIVEN STRING IS PALINDROME OR NOT. */

#include<stdio.h>
#include<conio.h>
void main()
{
   char str[20];
   int l,i;
   clrscr();

   printf("enter a string :  ");
   gets(str);

   l=strlen(str);

   for(i=0; i<l/2; i++)
   {
      if(str[i]!=str[l-1-i])
      {
  printf("string is NOT palindrome\n");
  break;
      }

   }
   if(i==l/2)
   {
      printf("string is palindrome\n");
   }
   getch();
}

    /*  OUTPUT  */
========================

enter a string :  abcba
string is palindrome

* * * * * * * * * * * * * *
http://www.dnpdeveloper.com

if you have like this blog so share and subscribe, comment for this blog.
if your any question, so comment pleass.
MY INSTAGRAM ID : dnp176

Comments

  1. great knowledge
    if anyone want to hire xamarin developer or other developer hire developers from Inwizards here you get best developers for growth.

    ReplyDelete

Post a Comment