write program for palindrome

Answer Posted / varun tiwari

#include<stdio.h>
#include<conio.h>
void main()
{
int n,s=0,m,r;
clrscr();
printf("enter any no");
scanf("%d",&n);
m=n;
while(n>0)
{
r=n%10;
s=s*10+r;
n=n/10;
}
if(s == m)
printf("the no is palindrome");
else
printf("no is not palindrome");
getch();
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is setbase c++?

619


How can we access protected and private members of a class?

583


What is the difference between while and do while loop? Explain with examples.

591


Is arr and &arr are same expression for an array?

576


State the difference between pre and post increment/decrement operations.

599






Can we delete this pointer in c++?

676


How to defines the function in c++?

603


Which programming language should I learn first?

572


Explain what you mean by a pointer.

619


What is format for defining a structure?

582


What can I safely assume about the initial values of variables which are not explicitly initialized?

617


What does obj stand for?

623


Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .

673


Explain the purpose of the keyword volatile.

626


What is the use of bit fields in structure declaration?

536