#include
<iostream>
#include
<stdio.h>
#include
<stdlib.h>
#include
<conio.h>
#include
<ctype.h>
void
datos (void)
{
printf ("Edith Juarez Juarez
\n\n");
printf
("Grupo 351\n\n");
}
int
alreves(int n, int digitos)
{
int resto, cocie;
if (n<10) // Si tenemos un número de dígitos menor a
2, devolvemos n
return n;
else
{
resto = n % 10;
cocie = n /
10;
return
resto*digitos + alreves(cocie, digitos/10);
}
}
int
main()
{
system ("Color 16");
datos();
int num, rev;
int digitos = 1;
int tmp;
printf("Este
programa nos dice si un numero es capicua o no \n\n");
printf("Dame
un numero: \n");
scanf("%d", &num);
tmp =num;
while (tmp>=10)
{
tmp=tmp/10;
digitos=digitos*10;
}
rev =
alreves(num, digitos);
if (rev==num)
printf("\nEste numero SI es capicua");
else
printf("\nEste numero NO es capicua");
getch();
return 0;
}


