?
Determine Output:
Determine Output:
void main()
{
static int var = 5;
printf("%d ", var--);
if(var)
main();
}
void main()
{
static int var = 5;
printf("%d ", var--);
if(var)
main();
}
Answer & Solution
Correct Answer:
Option
B
When static storage class is given, it is initialized once. The change in the value of a static variable is retained even between the function calls. Main is also treated like any other ordinary function, which can be called recursively.
Join the Discussion
Login to post a comment or share your explanation.
Loginvar is an int variable ,
If should contain a bool value write?