Advertisement
mahatma_xande

ex02lista05

Aug 22nd, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.20 KB | None | 0 0
  1. /*
  2. It sums the first 50 even integers.
  3. */
  4.  
  5. #include <stdio.h>
  6.  
  7. int main(){
  8.  
  9.     int k, n, s = 0;
  10.  
  11.     for(n = 0; n < 101; n = n + 2){
  12.         s = s + n;
  13.     }
  14.  
  15.     printf("%d\n", s);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement