manojbaishya

Loop Counter

Jun 19th, 2019
63
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(int argc, char *argv[]){
  4.     int j = 10;
  5.     int sum = 0;
  6.  
  7.     while(j <= 50){
  8.         j = j + 1;
  9.         sum = sum + 1;
  10.     }
  11.  
  12.     printf("Total number of times the loop ran: %d", sum);
  13.     getchar();
  14.     return 0;
  15. }
Add Comment
Please, Sign In to add comment