Answer to Question #15923 in C++ for ishba

Question #15923
c++ program to enter 4 digit number & print whether it is a palindrome or not
1
Expert's answer
2012-10-05T08:10:35-0400
#include <iostream>




using namespace std;




int main()

{

string s, r;

cin>>s;

for (unsigned int i = 0; i < s.length(); i++)

r = s[i] + r;

cout<<(s==r?"Yes":"No")<<endl;

system("PAUSE");

return 0;

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS