Skip to content

Instantly share code, notes, and snippets.

@byronmejia
Last active February 26, 2016 05:15
Show Gist options
  • Save byronmejia/769e5459e7ac7cbb4ff0 to your computer and use it in GitHub Desktop.
Save byronmejia/769e5459e7ac7cbb4ff0 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int fizzBuzz(int x) {
if((x % 3) == 0) cout << "fizz";
if((x % 5) == 0) cout << "buzz";
if(( (x % 3) && (x % 5) ) != 0) cout << x;
cout << endl;
if(x < 100){
return fizzBuzz(x + 1);
} else {
return 0;
}
}
int main() {
fizzBuzz(0);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment