/* This program shows the use of a static variable inside a function. See how the output changes if you remove the keyword static. */ #include int f(int); void main(){ for (int i=1; i<=3; i++) cout << f(i) << endl; } int f(int a){ int c; static int b = 1; c = a+b; b++; return c; }