Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int multiple_of_three_or_five (int number)
- {
- if (((number % 3) && (number % 5)) == 0)
- return 1;
- else
- return 0;
- }
- int main()
- {
- int total = 0, index = 1, condition = 0;
- for (index = 1; index < 1000; index++)
- {
- condition = multiple_of_three_or_five (index);
- if (condition == 1)
- total = total + index;
- }
- printf ("Total: %i\n", total);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement