Palindrome

 //WAP In C String is Palindrome
#include
void main()
 {
   char *S;
   int a,b;
   clrscr();
   printf("enter the sring->\t");
   scanf("%s",S);
   for(a=0;*(S+a)!='\0';a++);
   a=a-1;
   for(b=0;*(S+b)!='\0';b++)
     {
       if(*(S+b)!=*(S+a))
     {
        printf("it is not palindrome");
        getch();
        exit(1);
     }
       a=a-1;
     }
    printf("\n\n\n\n\t\t\t\tit is palindrome");
    getch();
 }

#vpsinghrajput

Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

0 comments:

Post a Comment