tel me program for pallindrome?
pallindrome
Collapse
X
-
Tags: None
-
//IN C[COMPILER VISUAL STUDIO 6,0]
#include <stdio.h>
#include <conio.h>
int main(void)
{
int input1,output1;
int digit1,digit2,d igit3;
do
{
printf("Enter three digit integer:");
scanf("%d",&inp ut1);
}
while((input1<1 00)||(input1>99 9));
digit1=input1%1 0;
input1/=10;
digit2=input1%1 0;
input1/=10;
digit3=input1%1 0;
digit1*=100;
digit2*=10;
digit3*=1;
output1=digit1+ digit2+digit3;
printf("\nThe pallindrome is %d",output1);
getch();
return 0;
}
/*HINT:for more digits ex:4 digits
use while((input<10 00)||(input>999 9));*/
Comment