Skip to content

Instantly share code, notes, and snippets.

@tuggan
Last active August 29, 2015 14:10
Show Gist options
  • Save tuggan/737c4e109d6a1f9124c3 to your computer and use it in GitHub Desktop.
Save tuggan/737c4e109d6a1f9124c3 to your computer and use it in GitHub Desktop.
Threw this togeather for a friend
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char **argv) {
int i, d = 0, m = 0, t = 0;
if (argc >=2) m = atoi(argv[1]);
if (m == 0) m = 6400;
if (argc >= 3) t = atoi(argv[2]);
if (t == 0) t = 20;
printf("Setting mouse sensetivity to %d\n", m);
printf("Setting range to test to 2 - %d\n", t);
printf("\n###########################################\n");
for(i = 2; i <= t; i++)
if(m % i == 0) {
printf("%d is evenly divisible by %4d = %d\n", m, i, m / i);
d += 1;
}
if(d) {
printf("###########################################\n\n");
printf("Done, found %d evenly divisable numbers.\n", d);
} else
printf("Could not find any evenly divisible numbers in that range.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment