C Codes
Beginners
C on Unix
Code Snippets
Data Structures
File Operations
Games Graphics
Gnu-Linux
Hardware
Mathematics
Miscellaneous
Small Programs
Sorting
C > Beginners Lab Assignments sample source codes
To check whether a string is a palindrome
To check whether a string is a palindrome #include<stdio.h> #include<conio.h> #include<string.h> void main(void) { char a[50],b[50]; clrscr(); printf("Enter the string:"); gets(a); strcpy(b,a); strrev(a); if(strcmp(b,a) == 0) { printf("The given string is a palindrome!!!"); } else { printf("The given string is not a palindrome!!!"); } getch(); }
Privacy Policy
|
Link to Us
|
Links