What is the output of below code?
main()
{
static in a=5;
printf("%3d",a--);
if(a)
main();
}
Answer Posted / srinivas reddy m v
54321
here main() is called again in main function
this leads to recursion....
the function is called until a become 0.
value is retained as static key word is used.
not much clear about usage of "%3d"
| Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
What is the use of volatile?
Why c is called a middle level language?
How is pointer initialized in c?
What is the time and space complexities of merge sort and when is it preferred over quick sort?
Differentiate between a for loop and a while loop? What are it uses?
Why isnt any of this standardized in c?
What is calloc malloc realloc in c?
What is file in c language?
Explain indirection?
What is the mean of function?
Where register variables are stored in c?
Where in memory are my variables stored?
Are the outer parentheses in return statements really optional?
How do we declare variables in c?
Explain enumerated types in c language?