C

Tuesday, 5 September 2017

Program To Check Whether A Given Number Is Palindrome Or Not.

#include<stdio.h>
main()
{
int num;
int temp;
int digit;
int rnum=0;
clrscr();
printf("Enter The Integer Number : ");
scanf("%d",&num);
temp=num;
do{
digit=temp%10;
temp=temp/10;
rnum=rnum*10+digit;
}
while(temp>0);
if(rnum==num)
printf("The Given Number Is Palindrome");
else
printf("The Given Number Is Not Palindrome");
}


No comments:

Post a Comment

Write a program to draw a circle using mid-point circle drawing algorithm.

#include<iostream.h> #include<graphics.h> #include<conio.h> void drawcircle(int x0, int y0, int r) {         ...