donmike25

ecp1016 tutorial 4(6do)

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