google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a c program to determine whether a string is palindrome - 2nd puc computer science

Write a c program to determine whether a string is palindrome

write a c program to determine whether a string is palindrome,palindrome program in c,string palindrome program in c using strrev

Write a c program to determine whether a string is palindrome

#include<stdio.h>

#include<conio.h>

#include<string.h>

void main()

{

char s[30],r[30];

clrscr();

printf("Enter the string: ");

gets(s);

strcpy(r,s);

strrev(r);

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

printf("It is a palindrome");

else

printf("It is not a palindrome");

getch();

}

Output:

 

run 1:

Enter the string: madam

It is a palindrome

 

run 2:

Enter the string: english

It is not a palindrome
Write a c program to determine whether a string is palindrome Write a c program to determine whether a string is palindrome Reviewed by Vision Academy on December 13, 2021 Rating: 5

No comments:

CheckOut

Powered by Blogger.