Created
November 7, 2014 20:49
-
-
Save kiloreux/10831db10575a5bb9dff to your computer and use it in GitHub Desktop.
My solution for Project Euler Smallest Multiple
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
#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