Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marzoukali/9ede846cf455472aa350c1053f53d637 to your computer and use it in GitHub Desktop.
Save marzoukali/9ede846cf455472aa350c1053f53d637 to your computer and use it in GitHub Desktop.
C++ Simple Problems 1
int divisionCount = 0;
for(int i =1; i<=100;++i)
 {
 if(i % 4 == 0)divisionCount++;
 else if(i % 6 == 0 && i % 10 == 0) divisionCount++;
}
cout << divisionCount; // 27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment