What is the output of the below program and how it is?
void main()
{
static int var=5;
printf("%d",var--);
if(var)
main();
}
Answer Posted / thiyagu
since the value of var is declared as static
the output will be 4 for each time printf is called by
recursive method main().
| Is This Answer Correct ? | 5 Yes | 19 No |
Post New Answer View All Answers
What is the sizeof () operator?
How can you draw circles in C?
What is the difference between scanf and fscanf?
please explain every phase in the "SDLC" in the dotnet.
What are local static variables? How can you use them?
What is printf () in c?
What do you mean by dynamic memory allocation in c? What functions are used?
Describe the order of precedence with regards to operators in C.
which is conditional construct a) if statement b) switch statement c) while/for d) goto
What is the process to generate random numbers in c programming language?
How can a program be made to print the name of a source file where an error occurs?
Explain what is the advantage of a random access file?
Where define directive used?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
What are unions in c?