Write a c program to compute two strings to check other there are equal and not equal using pointers
Answers
Answered by
0
#include<iostream.h>
#include<conio.h>
#include<string.h>
int main()
{
clrscr();
char str1,str2;
gets(str1);
gets(str2);
strcpy(str2,str1);
strrev(str2);
if (strcmp(str1,str2)==0)
cout<<"yes it is palindrome";
else
cout<<"it is not a palindrome";
getch();
return 0;
}
#include<conio.h>
#include<string.h>
int main()
{
clrscr();
char str1,str2;
gets(str1);
gets(str2);
strcpy(str2,str1);
strrev(str2);
if (strcmp(str1,str2)==0)
cout<<"yes it is palindrome";
else
cout<<"it is not a palindrome";
getch();
return 0;
}
Similar questions