-
-
Save andrei512/7972295 to your computer and use it in GitHub Desktop.
This file contains 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> | |
#include <stdlib.h> | |
/*3.6. De pe mediul de intrare se citeşte un număr natural n. Să se | |
verifice dacă numărul respectiv este palindrom. | |
*/ | |
int main() | |
{ | |
int n,ninv,aux; | |
printf("introduceti numarul: "); | |
scanf("%d",&n); | |
aux=n; | |
ninv=0; | |
while(aux>0) | |
{ | |
ninv=ninv*10+aux%10; | |
aux=aux/10; | |
} | |
if(ninv==n) | |
{ | |
printf(" Numarul introdus este palindrom!"); | |
} | |
else { | |
printf("Numarul nu este palindrom!"); | |
} | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment