Ticker

6/recent/ticker-posts

Header Ads Widget

program to check palindrome string

Program to check palindrome string

program to check palindrome string


A palindrome is a name, number, phrase, or other character sequence that reads the same way backwards. Names like madam or racecar or number 10801 are palindrome.

With a given string if the string back gives the same string we can say that the string provided is golf. Which means to look at the palindrome, we need to find out whether the first and last, second and last, 1, and so on are the same things or not.

Input - EMME

Output - the line is a palindrome

Input - a point of instruction

Output - the code is a palindrome


In a C ++ program to check if String Given is a Palindrome. The inserted string is copied to the new series, and we compare the first character with the last letter and the second letter with the last letter and others until the end of the string. If both characters have the same sequence of characters, e.g. The same is the cord is a palindrome or otherwise.

Q) Program to check plagrism of a string?
Sol)

#include<iostream.h>
#include<stdlib.h>
  int main() { 
 system (" cls"); 
string[80],c;
 cout<<"Enter a string(max. 79 characters)"; cin.getline(string,80);
for(int len = 0; string[len] != '\0'; ++len);
 int i, j, flag = 1;
  for(i = 0, j = len -1;i<len/2; ++i, --j)
   { if (string[i] != string[j])
   { flag = 0;
   break ;}
   }

if (flag)

cout << "It is palindrome \n";

else

cout << "It is not a palindrome \n";

return 0;
}






Other related post:-

Shutdown someone pc using notepad trick
Let window speak to you
Create quiz game using notepad
Program to check planidrome
Find factorial using program
Program to check leap year
Program to sort an array
Program to multiply two matrixes
Program to find root of quadratic equations
Array coding interview questions
Program creating basic calculator
Program to convert Fahrenheit to Celsius or Celsius to Fahrenheit
Program to implement distance formula


Top featured feeds
Top pattern problems
Array coding interview questions

Post a Comment

0 Comments