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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is stl stack?

665


Do you like to Submit Questions in Bulk under Same Category?? Then use our Bulk ListerDo you like to Submit Questions in Bulk under Same Category?? Then use our Bulk Lister

1666


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

2084


What is stl stand for?

742


sir please send me bpcl previous question papers

1961






What does stl stand for in basketball?

649


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

2328


What is stl language?

682


What is stl in c++ with example?

640


What do stl stand for?

647


What does stl mean in slang?

656


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

1978


To modify an, existing worksheet. What steps are involved for: 1. Inserting and deleting rows and columns. 2. Printing cell formulas 3Jld displayed values 3. Using the page setup command

1785


What are the different types of stl containers?

652


Describe how to safeguard a system through acquisition of an antivirus Program and systematic backup.

1648