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 do you mean by recursion in c?
List some basic data types in c?
What is a void pointer in c?
What is zero based addressing?
When should I declare a function?
What are the disadvantages of external storage class?
Can you write the algorithm for Queue?
Tell me what are bitwise shift operators?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
How can I ensure that integer arithmetic doesnt overflow?
Explain how can a program be made to print the name of a source file where an error occurs?
Why shouldn’t I start variable names with underscores?
What is #define used for in c?
What are the string functions? List some string functions available in c.
define string ?