Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. void func(void){
  4. static int val=0;
  5. printf("count=%d\n",val);
  6. val++;
  7. }
  8.  
  9. int main(void){
  10. int i;
  11. for(i=0;i<10;i++){
  12. func();
  13. }
  14. }
  15.  
  16. /*
  17. count=0
  18. count=1
  19. count=2
  20. count=3
  21. count=4
  22. count=5
  23. count=6
  24. count=7
  25. count=8
  26. count=9
  27. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement