palindrome for strings and numbers----Can anybody do the
prog?
Answer Posted / sree
#include<stdio.h>
void main
{
int n,t,d,r;
printf("Enter the number:");
scanf("%d",&n);
t=n;
while(n>=1)
{
d=n%10;
r=(r*10)+d;
n=n/10;
}
if(t==r)
printf("Palindrome");
else
printf("Not a palindrome");
}
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
How can you be sure that a program follows the ANSI C standard?
What is typedef struct in c?
What is volatile, register definition in C
What does it mean when a pointer is used in an if statement?
What is main () in c?
application attempts to perform an operation?
State two uses of pointers in C?
Write a code to remove duplicates in a string.
Can a function argument have default value?
How can I find out the size of a file, prior to reading it in?
how could explain about job profile
Write a code to generate a series where the next element is the sum of last k terms.
What is the size of structure pointer in c?
What functions are used in dynamic memory allocation in c?
How many types of errors are there in c language? Explain