Advertisement
horselurrver

Ch12 Ex5

Aug 15th, 2016
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int count(void);
  4.  
  5. int main(void){
  6.     int i;
  7.     for(i=0; i<25; i++){
  8.         printf("This function has been called %d times.\n", count());
  9.     }
  10.    
  11.     return 0;
  12. }
  13.  
  14. int count(void){
  15.     static int count=0;
  16.     count++;
  17.     return count;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement