srinivas


{ City } banglore
< Country > india
* Profession * student
User No # 79926
Total Questions Posted # 0
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 10
Users Marked my Answers as Wrong # 1
Questions / { srinivas }
Questions Answers Category Views Company eMail




Answers / { srinivas }

Question { TCS, 6092 }

What is the output of below code?
main()
{
static in a=5;
printf("%3d",a--);
if(a)
main();
}


Answer

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