donmike25

ecp1016 tutorial 4(6dowhile)

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