palindrome for strings and numbers----Can anybody do the
prog?

Answer Posted / arup bhattacharya

#include<stdio.h>
#include<conio.h>
void main()
{
int n,r,temp;
int s=0;
clrscr();
printf("enter the number");
scanf("%d",&n);
temp=n;
while(temp>0)
{
r=temp%10;
s=s*10+r;
temp=temp/10;
}
if(n==temp)
printf(number is pallindrome");
else
printf("not pallindrome");
getch();
}

Is This Answer Correct ?    9 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the function of pragma directive in c?

615


Which is better pointer or array?

592


Explain what happens if you free a pointer twice?

602


what type of questions arrive in interview over c programming?

1548


What is difference between structure and union with example?

586






What is pre-emptive data structure and explain it with example?

3203


How do you sort filenames in a directory?

700


How can I find out if there are characters available for reading?

635


How can I split up a string into whitespace-separated fields?

562


What is sizeof array in c?

588


write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1

3270


int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer

645


How many types of operators are there in c?

611


Write a code to determine the total number of stops an elevator would take to serve N number of people.

722


Why we use break in c?

543