Displaying Source Code(s)
|
|
Program to find the palindrome of a number.
--------------------------------------------------------------------------------
Description : This is a program to find the reverse fo a number
i.e, if we give the input as 123 the user is expected the output
as 321.
#include<stdio.h>
#include<conio.h>
main()
{
int rev=0,num=0,rem;
printf("enter the number<BR>);
scanf("%d",&num);
if(num>0)
{
num=num/10;
rev=rev*10+num;
rem=rem%10;
}
printf("the palindrome of number is ",rev);
|
|
|