Advertisement
Aminpro

[ECP 1016]Tutorial 4 question 7 (For loop)

Jul 1st, 2012
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  1. //https://www.facebook.com/AminproPastebin
  2.  
  3. #include <stdio.h>
  4.  
  5. int main(void)
  6. {
  7.         int counter;
  8.     int sum=0;
  9.    
  10.         for(counter =1; counter <=50; counter++ ) {
  11.     sum = sum +counter;
  12.    
  13.         printf("%d", sum);
  14. }
  15.    
  16.        
  17. getchar();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement