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 meant by stl in c++?

0 Answers  


sir please send me bpcl previous question papers

0 Answers   BPCL Bharat Petroleum,


What are the different types of stl containers?

0 Answers  


What is the use of stl?

0 Answers  


How the STL's are implemented, What the difference between templates and STL?

1 Answers   Symphony,






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  


what is use of for loop?

9 Answers   Wipro,


why & sign is used in copy constructor

4 Answers  


give me the defination of inheritance?

5 Answers   Infosys,


In what scenario does the Logical file and Physical file being used?

0 Answers   informatics,


What is a standard template library (stl)? What are the various types of stl containers?

0 Answers  


What is C++ could you enplane me please?

1 Answers  


Categories