#include<stdio.h> #include<conio.h> void main() { int n,s=0,m; clrscr(); printf("enter any no"); scanf("%d",&n); m=n; while(n>0) { r=n%10; s=s*10+r; n=n/10; } if(m==n) printf("the no is palindrome"); else printf("no is not palindrome"); getch(); }
You don't have to write palindrome programs in wikipedia.
what ever you assume
int pallindrom(int p){ /*write all logic*/ }
sdfdg
It is a simple program. i think u may understand it :#include#include#includevoid main(){char s[10]=answers.com;char x[10];int a;clrscr();strcpy(x,s);strrev(s);a=strcmp(s,x);if(a==0){printf("the entered string is palindrome");}else{printf("the entered string is not palindrome");}output:given string is not palindrome
char* = "racecar"
Nothing.
/*To check whether a string is palindrome*/includeincludevoid 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 (); }
You can do this: <?php if ( $word === strrev( $word ) ) { echo "The word is a palindrome"; } else { echo "The word is not a palindrome"; }
The word 'cow' is not a palindrome because it is not spelled the same backward and forward (c-o-w, w-o-c).
#include<stdio.h> #include<conio.h> #include<string.h> void main() { char a[15],b[15]; printf("Enter the string\n"); scanf("%s",&a); strcpy(b,a); strrev(a); if(strcmp(a,b)==0) printf("The String is a palindrome"); else printf("The String is not a palindrome"); }
please somebody should help me answer this question..I have a project on it even! It seems almost impossible at the moment.