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 DIFFERENCE BETWEEN C++ AND VC++

1 Answers   Syntel,


Assume I have a linked list contains all of the alphabets from "A" to "Z?" I want to find the letter "Q" in the list, how does you perform the search to find the "Q?"

2 Answers  


Define stl.

0 Answers  


What do you mean by stl?

1 Answers  


how to swap two numbers in a linked list without exchanging the data but only the links?

3 Answers   Wipro,






How can you create a bulleted list, numbered list and an outline by using bullets and numbering command. Explain with the help of example.

0 Answers  


5. Write c++ function that would intake a string and return the number of occurrences of a given character in that sring Ex:- if the word is “Colombo” and count the occurrences of the letter “o” the function would return 3

1 Answers  


i want a road rash 3d game code if some one know please help me

1 Answers  


if x<>=z then statement end what is the cyclomatic complexity

5 Answers  


Give two integer arrays A & B.A has n elements and B has ' n-1 ' elements . A has all the elements that are there in B. But B has one missing element. Write a function that takes arrays , A & B as imnput and finds the missing element in most optised manner .

4 Answers   Zycus Infotech,


WHAT IS FIBONACCI SERIES?

4 Answers   Stewart,


How does an stl file work?

0 Answers  


Categories