#include<stdio.h> int K = 10; int main() { foo(); foo(); return 0; } int foo() { static int k= 1; printf("%d ",k); k++; return 0; }
What is the output of the above code snippet?
ans B
1st time foo is called then k=1 pf(1) k=2
2nd time foo is called then k=2 pf(2) k=3
op=1,2
64.3k questions
77.9k answers
244k comments
80.0k users