Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- void imprime_pares(int n);
- int main() {
- int numero = 0;
- printf("Digite o numero: ");
- scanf("%d", &numero);
- imprime_pares(numero);
- return 0;
- }
- void imprime_pares(int n) {
- if(n < 2)
- exit(1);
- else if (n % 2 == 0)
- printf("%d-", n);
- imprime_pares(n-1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement