help on palindrome
i have make a program that can trace palindrome number but i need it to loop over and over again till i keyin -1 then only the program terminate
this is the code that i have used:
Code:
#include<stdio.h>
#include<string.h>
void main()
{
char strsrc[5];
char strtmp[5];
printf("\n Enter a five-digit number ( -1 to end ): "); gets(strsrc);
strcpy(strtmp,strsrc);
strrev(strtmp);
if(strcmp(strsrc,strtmp)==0)
printf("\n %s is a palindrome\n",strsrc);
else
printf("\n %s is not a palindrome\n",strsrc);
}
any one can help?