adspace


how to write palindrome program?

Answer Posted / a.prathyusha

#include<stdio.h>
void main()
{
int n,s=0,r,n1;
printf("enter any number:");
scanf("%d",&n);
n1=n;
while(n>0)
{
r=n%10;
s=(s*10)+r;
n=n/10;
}
if(s==n1)
printf("palindrom");
else
printf("not palindrom");
}

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pointer to pointer in c with example?

1200


Differentiate between null and void pointers.

1259


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2829


What is the difference between union and anonymous union?

1399


will u please send me the placement papers to my mail???????????????????

1930


Do you know the difference between malloc() and calloc() function?

1135


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2516


How do you convert strings to numbers in C?

1346


i have a written test for microland please give me test pattern

2814


Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.

5449


How do you determine the length of a string value that was stored in a variable?

1205


What is variable initialization and why is it important?

1394


Is int a keyword in c?

1059


write a program to find out prime number using sieve case?

2176


How can I implement sets or arrays of bits?

1119