my program is as follows:
what i did so far is wait for a user input and then check for palindromes. How do i change it so that I can use a file with a few lines to check each line if it is a palindrome and go on till the eof.Code:#include<stdio.h> #include<string.h> #define size 100 void main() { char strsrc[size]; char strtmp[size]; printf("\n Enter String:= "); gets(strsrc); strcpy(strtmp,strsrc); strrev(strtmp); if(strcmp(strsrc,strtmp)==0) printf("\n Entered string \"%s\" ispalindrome",strsrc); else printf("\n Entered string \"%s\" is not palindrome",strsrc); }



LinkBack URL
About LinkBacks


