montimaj

LEARNING STATIC

May 25th, 2014
223
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. //#include<conio.h>
  3. int val()
  4. {
  5.     static int c=0;
  6.     c++;
  7.     return c;
  8. }
  9. int main()
  10. {
  11.     int x=val();
  12.     printf("%d\n",x);
  13.     x=val();
  14.     printf("%d\n",x);
  15.     return 0;
  16.     //getch();
  17. }
Add Comment
Please, Sign In to add comment