Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int num,cif1,cif2;
- printf("Ingrese el número que desea verificar (debe contener 3 cifras):\n");
- scanf("%d",&num);
- if (num>=100 && num<=999){
- cif1=num/100;
- if (num%100>9){
- cif2=(num%100)%10;
- }
- else {
- cif2=num%100;
- }
- if (cif1==cif2){
- printf("El número %d es CAPICÚA.\n",num);
- }
- else {
- printf("El número ingresado no es capicúa.\n");
- }
- }
- else{
- printf("El número ingresado no posee 3 cifras...\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement