dcowboys107 Posted November 29, 2005 Posted November 29, 2005 What is the smallest number that is divisible by 13 but when divided by the whole numbers 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12 yields a remainder of 1?
NeonBlack Posted November 30, 2005 Posted November 30, 2005 Certainly. #include <stdio.h> int main (void) { int x = 13; do { if (x % 2 == 1 && x % 3 == 1 && x % 4 == 1 && x % 5 == 1 && x % 6 == 1 && x % 7 == 1 && x % 8 == 1 && x % 9 == 1 && x % 10 == 1 && x % 11 == 1) { printf ("%d", x); return 0; } x += 13; } while (1); } It does the job.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now