C/C++ Program to Check if a Given String is Palindrome

Palindrome:  A string is called palindrome if its reverse of the string is the same as the original string. For Example: “GEEG”, “LOOL”,”AABBBAA”.

The most asked questions in TCS/ Wipro/Infosys and other MNC.

Program in C/C++ to check the string is Palindrome or Not.

#include <iostream>
#include <string>

using namespace std;

int main ()
    string st;
    cout<<"Enter String ";
    int i=0;
    int l=st.size()-1;
            cout<<"It is not Pallindrome";
            return 0;
    cout<<"It is Pallindrome";

return 0;
Output:It is Pallindrome

Output:It is not Pallindrome

Compile Program Here 

Most Asked Question in Interview.

By geekycodesco

Leave a Reply

%d bloggers like this: