Skip to content

Instantly share code, notes, and snippets.

@rahuldottech
Created September 22, 2018 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahuldottech/90ec4e65fecddbb5a028d31a65313d81 to your computer and use it in GitHub Desktop.
Save rahuldottech/90ec4e65fecddbb5a028d31a65313d81 to your computer and use it in GitHub Desktop.
What I wrote while watching Tom Scott's video. Turned out pretty well. https://www.youtube.com/watch?v=QPZ0pIK_wsc
#include<iostream>
int main(){
using namespace std;
for(int i=1; i<101; i++){
if(i%3==0){
cout<<"Fizz";
}
if(i%5==0){
cout<<"Buzz";
}
if (i%3 !=0 && i%5 !=0){
cout<<i;
}
cout<<endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment