palindrome for strings and numbers----Can anybody do the
prog?
Answer Posted / dally
#include<stdio.h>
int main()
{
int n,sum=0,temp;
printf("Enter nuber\n");
scanf("%d",&n);
temp = n;
while(n>1)
{
n = n%10;
sum = n + sum*10;
n = n / 10;
}
if(temp == sum)
printf("Given number is polindram\n");
else
printf("Given number is not polindram\n");
}
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Tell us something about keyword 'auto'.
What is pragma in c?
Do pointers store the address of value or the actual value of a variable?
What is the maximum length of an identifier?
What is the difference between typedef and #define?
Explain what are preprocessor directives?
What is the purpose of clrscr () printf () and getch ()?
Does c have an equivalent to pascals with statement?
Is there any demerits of using pointer?
What is array in C
What is use of integral promotions in c?
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?
Can you please explain the scope of static variables?
What is the difference between call by value and call by reference in c?
Describe the modifier in c?