Write a program to check if the given string is palindrome or not in c
Answers
Answered by
1
Answer:
Palindrome number in C
#include <stdio.h>
int main()
{
int n, r = 0, t;
printf("Enter an integer to check if it is palindrome or not\n");
scanf("%d", &n);
t = n;
while (t != 0)
Answered by
2
Answer:
#include <stdio.h>
int main()
{
char arr[100];
printf("Enter the string ");
scanf("%s",arr);
int check=0;
int l=strlen(arr);
for(int i=0;i<l;i++)
{
if(arr[i]!=arr[l-i-1])
{
check=1;
printf("It's not palindrome");
break;
}
}
if(check==0)
printf("It's a palindrome string");
return 0;
}
Explanation:
Hope it helps :-)
Similar questions
Accountancy,
6 months ago
Computer Science,
6 months ago
Physics,
6 months ago
Computer Science,
1 year ago
Economy,
1 year ago