Advertisement
Aminpro

[ECP 1016]Tutorial 4 number 7 (Do while loop)

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