The following program
main()
{
inc(); inc(); inc();
}
inc()
{
static int x;
printf("%d", ++x);
}
A. | prints 012 |
B. | prints 123 |
C. | prints 3 consecutive, but unpredictable numbers |
D. | prints 111 |
Answer : B Explanation : By default x will be initialized to 0. Since its storage class is static, it presents its exit value ( and forbids reinitialization on re-entry ). So, 123 will be printed. |
|
Option: A Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. |