Created
September 28, 2017 06:32
-
-
Save unaipme/2dfd47d295cafcf979e72165046aab69 to your computer and use it in GitHub Desktop.
Zenbaki bat kapikua den ala ez jakiteko kodea
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) { | |
int n, nAlderantziz, nKopia; | |
printf("Sartu zenbakia: "); | |
scanf("%d", &n); | |
nKopia = n; | |
nAlderantziz = 0; | |
while (n >= 1) { | |
nAlderantziz = nAlderantziz * 10; // nAlderantziz *= 10; | |
nAlderantziz = nAlderantziz + (n % 10); // nAlderantziz += n % 10; | |
n = n / 10; // n /= 10; | |
} | |
if (nKopia == nAlderantziz) { | |
printf("Zenbakia kapikua da.\n"); | |
} else { | |
printf("Zenbakia ez da kapikua\n"); | |
} | |
getchar(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment