Skip to content

Pro Programming

Professional way of Programming

  • Home
  • C MCQs
  • C/C++
  • Java
  • Python
  • MySQL
  • Online Compiler
  • Topics
    • Arrays
    • Strings
    • Link Lists
    • Trees
    • Shapes
    • Articles
    • Games
    • Projects

Program to check whether String is palindrome or not C++

A simple program to check whether String is palindrome or not C++

PROGRAM:

#include<iostream>
using namespace std;

int main( )
{
    int L,C;
    char str[80];
    cout<<"nEnter a string: ";
    gets(str);

    for(L=0;str[L]!='';L++);      //To find length of the string

    for(C=0;(C<L/2) && (str[C]==str[L-C-1]);C++);

    if(C==L/2)
        cout<<"ntString is Palindrome";
    else
        cout<<"ntNot a palindrome";
    return 0;
}

 

OUTPUT:

string is palindrome or not c++

Related Posts:

  • Python program to check if String is Palindrome or not
  • Java Program to Check Whether Antialiasing is Enabled or Not
  • Program to Check if a number is Palindrome Number C++
  • Python program to check whether the given number is Even or Odd
  • C++ Program to check if word exists in Grid or not
  • Check if sum of Fibonacci elements in an Array is a Fibonacci number or not
  • Check if an Array is mirror inverse or not
  • Java String to String Array Example
  • package javax.validation.constraints does not exist error in spring boot 2.3
  • Java Program to Display String in Rectangle
  • Java Convert int Array To String Example
  • Java Reverse String Array Example
  • Java Sort String Array Example
  • Java Stacktrace to String Example
  • Java Date to String Example
Categories string
Post navigation
Program to Find length of String C++
Program to Reverse String C++

Leave a Comment Cancel reply

Must See Content

  • Python program to check if String is Palindrome or not
  • Java Program to Check Whether Antialiasing is Enabled or Not
  • Program to Check if a number is Palindrome Number C++
  • Python program to check whether the given number is Even or Odd
  • C++ Program to check if word exists in Grid or not
  • Check if sum of Fibonacci elements in an Array is a Fibonacci number or not
  • Check if an Array is mirror inverse or not
  • Java String to String Array Example
  • package javax.validation.constraints does not exist error in spring boot 2.3
  • Java Program to Display String in Rectangle

Recent Comments

  • David Bolton on Last Minute Notes: C and C++
  • Alisha Ross on Some mind blowing facts about Computers
  • Binary Search Tree implementation in C++ - Pro Programming on Program to check if Tree is Binary Search Tree C++
  • C++ program to implement AVL Tree - Pro Programming on Red Black-Tree(RB-Tree) implementation in C++
  • Program to Find Perfect Number in Python - Pro Programming on Program to find Perfect Number Program in C++
  • Email
  • Facebook
  • Twitter

Related Posts:

  • Python program to check if String is Palindrome or not
  • Java Program to Check Whether Antialiasing is Enabled or Not
  • Program to Check if a number is Palindrome Number C++
  • Python program to check whether the given number is Even or Odd
  • C++ Program to check if word exists in Grid or not
  • Check if sum of Fibonacci elements in an Array is a Fibonacci number or not
  • Check if an Array is mirror inverse or not
  • Java String to String Array Example
  • package javax.validation.constraints does not exist error in spring boot 2.3
  • Java Program to Display String in Rectangle

Recent Posts

  • How to use MySQLDump effectively for backups
  • Top 10 Games for Beginners to learn programming the easy way
  • A simple Zombie War Game in C++
  • Mobile Numeric Keypad Problem: Solution in C++
  • Last Minute Notes: C and C++
  • JavatPoint Offline version Download Free
  • How to count number of non repeating digits in a Range C++
  • C++ Program to check if word exists in Grid or not
  • Top Cryptocurrency list of 2021
  • C Program to Implement Coppersmith Freivald’s Algorithm
© 2020 | ProProgramming | About | Contact US | Privacy Policy