Last active
December 19, 2015 14:18
-
-
Save sergiosvieira/5968029 to your computer and use it in GitHub Desktop.
Multiples of 5, 7 and 35
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
#import <Foundation/Foundation.h> | |
/** | |
Author: Sérgio Vieira - [email protected] - 2013 | |
**/ | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
NSUInteger max = 100; | |
for (NSUInteger i = 1; i <= max; i++) | |
{ | |
if (i % 35 == 0) | |
{ | |
printf("DasDad"); | |
} | |
else if (i % 5 == 0) | |
{ | |
printf("Das"); | |
} | |
else if (i % 7 == 0) | |
{ | |
printf("Dad"); | |
} | |
else | |
{ | |
printf("%ld", i); | |
} | |
if (i < max) | |
{ | |
printf(","); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment