how to write palindrome program?

Answer Posted / shweta

when we do reverse any no then we find a new no and this
no is equal to our privous no,which is called palindrom no.
by program
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int n,m,sum=0,l;
printf("enter any no");
scanf("%d",&n);
while(n>0)
{
m=n%10;
sum=sum*10+m;
n=n\10;
}
if(n==l)
{
printf("no is palindrom");
}
else
{
printf("no is not palindrom");
}
getch();
}

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the use of keyword 'register' with respect to variables.

600


What is the purpose of 'register' keyword in c language?

637


The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.

1641


Using which language Test cases are added in .ptu file of RTRT unit testing???

3611


how should functions be apportioned among source files?

634






Why is void main used?

628


Is null a keyword in c?

745


What are the functions to open and close file in c language?

738


What are the back slash character constants or escape sequence charactersavailable in c?

702


in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.

7423


Explain how can I manipulate strings of multibyte characters?

792


What are all different types of pointers in c?

589


Explain what will the preprocessor do for a program?

610


write a programming in c to find the sum of all elements in an array through function.

1716


Why do we use namespace feature?

590