Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int multiple_of_three_or_five (int number)
  5. {
  6.     if (((number % 3) && (number % 5)) == 0)
  7.         return 1;
  8.     else
  9.         return 0;
  10. }
  11.  
  12.  
  13. int main()
  14. {
  15.     int total = 0, index = 1, condition = 0;
  16.  
  17.     for (index = 1; index < 1000; index++)
  18.         {
  19.             condition = multiple_of_three_or_five (index);
  20.  
  21.             if (condition == 1)
  22.                 total = total + index;
  23.         }
  24.  
  25.     printf ("Total: %i\n", total);
  26.     return 0;
  27. }