Skip to content

Instantly share code, notes, and snippets.

@esn89
Created January 22, 2013 02:18
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 esn89/4591497 to your computer and use it in GitHub Desktop.
Save esn89/4591497 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
void smallestMult() {
for(int i=1; i<=999999999; i++) {
if(i%2 == 0 && i%3 == 0 && i%4 == 0 && i%5 == 0 && i%6 == 0 && i%7 == 0 && i%8 == 0 && i%9 == 0
&& i%10 == 0 && i%11 == 0 && i%12 == 0 && i%13 == 0 && i%14 == 0 && i%15 == 0 && i%16 == 0
&& i%17 == 0 && i%18 == 0 && i%19 == 0 && i%20 == 0 ) {
cout << i << endl;
break;
}
}
}
int main() {
smallestMult();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment