Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "iostream"
- #include "string.h"
- using namespace std;
- main()
- {
- char input[64];
- char rev_str[64];
- cout << "input : ";
- cin >> input;
- strlwr(input);
- strcpy(rev_str,input);
- strrev(rev_str);
- cout << "reverse : " << rev_str << endl;
- if(strcmp(input,rev_str) == 0)
- {
- cout << input << " is palindrome" << endl;
- }
- else
- {
- cout << input << " isn't palindrome" << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement