SHARE
TWEET

Untitled

a guest Jun 19th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3.  
  4. int main (int argc, const char * argv[]) {
  5.  
  6.    
  7.     int i, target, sum;
  8.     sum = 0;
  9.     target = 999;
  10.    
  11.     for (i = 0; i <= target; i++) {
  12.             if ( ((i % 3) == 0) || ((i % 5) == 0) ) {
  13.                 sum += i;
  14.             }
  15.     }
  16.    
  17.     printf("%d ", sum);
  18.    
  19.    
  20.     return 0;
  21. }
RAW Paste Data
Top