How do you check given string is palindrome or not with out using string functions?

1 answer

Answer

1198210

2026-05-06 17:30

+ Follow

/*To check whether a string is palindrome*/

  1. include
  2. include
void main () {
int i,j,f=0;
char a[10];
clrscr ();
gets(a);
for (i=0;a[i]!='\0';i++)
{
}
i--;
for (j=0;a[j]!='\0';j++,i--)
{
if (a[i]!=a[j])
f=1;
}
if (f==0)
printf("string is palindrome");
else printf("string is not palindrome");
getch ();
}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.