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
what is the function of pragma directive in c?
Which is better pointer or array?
Explain what happens if you free a pointer twice?
what type of questions arrive in interview over c programming?
What is difference between structure and union with example?
What is pre-emptive data structure and explain it with example?
How do you sort filenames in a directory?
How can I find out if there are characters available for reading?
How can I split up a string into whitespace-separated fields?
What is sizeof array in c?
write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1
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
How many types of operators are there in c?
Write a code to determine the total number of stops an elevator would take to serve N number of people.
Why we use break in c?