Last active
December 21, 2015 07:49
-
-
Save talespadua/6273811 to your computer and use it in GitHub Desktop.
Exercício para a DasDas escrito em C. Imprime os números de 1 a 100. Se for múltiplo de 5, imprime "Das", múltiplo de 7, imprime "Dad" e múltiplo de ambos imprime "DasDad"
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> | |
void dasDad(){ | |
int i; | |
for(i = 1; i <= 100; i++){ | |
if(i % 5 == 0)printf("Das"); | |
if(i % 7 == 0)printf("Dad"); | |
if((i % 5 != 0) && (i % 7 != 0)) printf("%d", i); | |
if(i != 100)printf(", "); | |
} | |
} | |
main(){ | |
dasDad(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment