write a program that input four digit no and finds it is
palindrome or not

Answers were Sorted based on User's Feedback



write a program that input four digit no and finds it is palindrome or not..

Answer / karthik p b

#include<stdio.h>
#include<conio.h>

void main()
{
int n,rev=0,rem, temp,i;

printf(" Enter the 4 digit number :\n");
scanf("%d", &n);

temp = n;
for(i=1;i<=4;i++)
{
rem = n % 10;
n = n/10;
rev = rev * 10 + rem;
}

if(temp == rev)
printf(" Its a palindrome:\n");
else
printf(" Not a palindrome:\n");
getch();
}

Is This Answer Correct ?    1 Yes 0 No

write a program that input four digit no and finds it is palindrome or not..

Answer / abhi

use stack

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More STL Interview Questions

What is the name of your birth place?

0 Answers  


Who wrote stl?

0 Answers  


Explain when u will use Observer pattern and how u will implement in c++ .

1 Answers  


What do stl stand for?

0 Answers  


write a program to search and display the position of an element in a single-dimentional array using function.

1 Answers  






write a c++ program to create an object of a class called employee containing the employee code name designation basic salarry HRA Da gross salary as data 10 such objects "members process "

1 Answers  


why & sign is used in copy constructor

4 Answers  


Name the different types of stl containers.

0 Answers  


write a program to convert a decimal number in to its equivalent binary number?

0 Answers  


what's the difference between abstract class and concreate class? what's the meaning of standard template library(STL)?

2 Answers  


what's the difference between function overloading and function overiding?

5 Answers  


Find the error in the following program struct point {struct point *next; int data; } x; main() {int...data; } x; main() {int i; for(x=p;x!=0;) x=x->next,x++; freelist(x); } freelist(x) {free(x); return }

1 Answers   Sun Microsystems,


Categories