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


Please Help Members By Posting Answers For Below Questions

In a switch statement, what will happen if a break statement is omitted?

598


Why does not c have an exponentiation operator?

624


What is a structure member in c?

539


Explain what standard functions are available to manipulate strings?

609


a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.

4540






write a proram to reverse the string using switch case?

2461


write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);

1838


Array is an lvalue or not?

633


What is the difference between test design and test case design?

1564


What is wrong with this program statement?

607


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

722


What is actual argument?

587


Explain what are the advantages and disadvantages of a heap?

595


Explain the advantages of using macro in c language?

572


How do you do dynamic memory allocation in C applications?

626