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
if p is a string contained in a string?
What are the 4 data types?
Why is c faster?
Why do we use int main instead of void main in c?
Difference between exit() and _exit() function?
Are there constructors in c?
What is dynamic dispatch in c++?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
Explain can the sizeof operator be used to tell the size of an array passed to a function?
What are comments and how do you insert it in a C program?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
Did c have any year 2000 problems?
What does printf does?
Is Exception handling possible in c language?
What is selection sort in c?