Skip to content

Instantly share code, notes, and snippets.

@kiloreux
Created November 7, 2014 20:49
Show Gist options
  • Save kiloreux/10831db10575a5bb9dff to your computer and use it in GitHub Desktop.
Save kiloreux/10831db10575a5bb9dff to your computer and use it in GitHub Desktop.
My solution for Project Euler Smallest Multiple
#include<iostream>
using namespace std;
bool EvenlyDivisible(int num)
{
for(int i=1;i<=20;i++)
{
if(num%i!=0)
{
return false;
}
}
return true;
}
int main(void)
{
int o=20;
while(!EvenlyDivisible(o))
{
o+=20;
}
cout<<"Your number is :"<<o<<endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment