palindrome for strings and numbers----Can anybody do the
prog?
Answer Posted / subbu
/*some corrections to above solution*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n,r,temp;
int s=0;
printf("enter the number");
scanf("%d",&n);
temp=n;
while(temp>0)
{
r=temp%10;
s=s*10+r;
temp=temp/10;
}
if(n==s)
printf("number is pallindrome");
else
printf("not pallindrome");
getch();
}
| Is This Answer Correct ? | 10 Yes | 5 No |
Post New Answer View All Answers
What is a static function in c?
Can static variables be declared in a header file?
Do pointers store the address of value or the actual value of a variable?
What is a void pointer in c?
What is n in c?
What is a global variable in c?
What are the 5 types of inheritance in c ++?
How does placing some code lines between the comment symbol help in debugging the code?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above
write an algorithm to display a square matrix.
What does c value mean?
Is there a way to compare two structure variables?
When should you not use a type cast?
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)