Wednesday, October 31, 2018

STRING: PROGRAM TO CHECK WHETHER THE STRING IS PALINDROME OR NOT

#include<stdio.h>
#include<string.h>
void main()
{
char str[10],str2[10];
printf("Enter the string:");
gets(str);
strcpy(str2,str);
strrev(str2);
if(strcmp(str,str2)==0)
printf("palindrome");
else
printf("not palindrome");
}

No comments:

Post a Comment

Static Member Function

CODE : #include<iostream> using namespace std; class test  {     int code;       static int count;               //static...