write program for palindrome

Answers were Sorted based on User's Feedback



write program for palindrome..

Answer / felix

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

Is This Answer Correct ?    242 Yes 354 No

Post New Answer

More C++ General Interview Questions

If dog is a friend of boy and boy is a friend of house, is dog a friend of house?

0 Answers  


What is function prototyping?

0 Answers  


How would you stop a class from class from being derived or inherited?The constructer should not be Private,as object instantiation should be allowed.

15 Answers   Satyam,


What is a forward referencing and when should it be used?

0 Answers  


What are advantages of c++?

0 Answers  






What is late binding c++?

0 Answers  


What is the most powerful coding language?

0 Answers  


What is the use of ::(scope resolution operator)?

0 Answers  


Explain what is class definition in c++ ?

0 Answers  


What is flag in computer?

0 Answers  


Define 'std'.

0 Answers  


i want to know how to copy arrary without using any method or function. I have tried the below using System; class e4 { static void Main(string[] args) { int a,b; int[ ] m= new int[5]; int[ ] n= new int[5]; for(a=0;a<=4;a++) { Console.WriteLine("enter any value"); m[a]=Convert.ToInt32(Console.ReadLine()); m[a]=n[a]; } for(b=0;b<=4;b++) { Console.WriteLine(n[b]); } } } but it will give wrong result can anyone solve this problem

1 Answers   Reliance,


Categories