google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a program to check whether a given string is a palindrome or not - 2nd puc computer science

Write a program to check whether a given string is a palindrome or not

// Write a program to check whether a given string is a palindrome or not

#include<iostream.h>

#include<conio.h>

#include<string.h>

void main()

{

char s[100],r[100];

clrscr();

cout<<"Enter the string: ";

cin.getline(s,100);

strcpy(r,s);

strrev(r);

if(strcmpi(s,r)==0)

cout<<"It is palindrome";

else

cout<<"It is not palindrome";

getch();

}

Write a program to check whether a given string is a palindrome or not Write a program to check whether a given string is a palindrome or not Reviewed by Vision Academy on February 27, 2022 Rating: 5

No comments:

CheckOut

Powered by Blogger.