Created
January 15, 2016 23:51
-
-
Save jesuslerma/fd9015ebed80d784eae0 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
int array[100]; | |
for(int i = 0; i < array.length(); i ++) { | |
if (isFizz(array[i]) && isBuzz(array[i])) cout << "FizzBuzz" << endl; | |
else if ( isFizz(array[i])) cout << "Fizz" << endl; | |
else if (isBuzz(array[i])) cout << "Buzz" << endl; | |
} | |
bool isFizz(int elem) { | |
return ( elem % 3 == 0); | |
} | |
bool isBuzz(int elem) { | |
return ( elem % 7 == 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment