Write a Program that accept a number and check if palindorme or not

#include <stdio.h>
#include <conio.h>
void main()
{
int no,rev;
clrscr();
printf("Enter the number:-");
scanf("%d",&no);
ent:
rev=no%10;
no=no/10;
if (no>0)
goto ent;
if (no==rev)
printf("%d is equal to reverse no",no);
else
printf("%d is not equal to reverse no",no);
getch();
}

No comments:

Post a Comment

Related Post

Array:
String functions:
General (Loops-for/while)
Write a Program to print reverse of a given number Write a Program to print Product of Digits (eg. 212=2*1*2=4) of a given number Write a C++ Program to Convert Binary into Decimal Number