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
In a switch statement, what will happen if a break statement is omitted?
Why does not c have an exponentiation operator?
What is a structure member in c?
Explain what standard functions are available to manipulate strings?
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.
write a proram to reverse the string using switch case?
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 []);
Array is an lvalue or not?
What is the difference between test design and test case design?
What is wrong with this program statement?
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
What is actual argument?
Explain what are the advantages and disadvantages of a heap?
Explain the advantages of using macro in c language?
How do you do dynamic memory allocation in C applications?