Advertisement
godsqueezy

lab 3 ex 17

Feb 8th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int n, s;
  7.     s = 0;
  8.  
  9.     for (n = 1; n <= 12; ++n ){
  10.  
  11.         if (n % 3 == 0 ){
  12.         s = s + n;
  13.         }
  14.  
  15.     }
  16.     printf("%d\n", s);
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement