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
Explain what is the difference between a free-standing and a hosted environment?
cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration
What is boolean in c?
How are strings stored in c?
Why we write conio h in c?
What is self-referential structure in c programming?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
How is a pointer variable declared?
Explain the term printf() and scanf() used in c language?
Explain function?
What is double pointer?
What is fflush() function?
If errno contains a nonzero number, is there an error?
What are the restrictions of a modulus operator?
What is LINKED LIST? How can you access the last element in a linked list?