Hello people. I'm back with some more annoying pieces of code, and their explanations to ease your annoyance.I hope you have already gone through my previous post Some annoying C programs-Part I. If not then I recommend you to read my previous post
ALSO READ:(RECOMMENDED)
- SOME ANNOYING C PROGRAMS-PART I (FREQUENTLY ASKED QUESTION MUST READ)
- SOME ANNOYING C PROGRAMS-PART III (FREQUENTLY ASKED QUESTION MUST READ)
- main(){static int var = 5;printf("%d ",var--);if(var)main();}Answer:5 4 3 2 1Explanation: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.
FULL DOCUMENT IS HERE SO DOUBLE CLICK TO GET THIS PDF
It was very informative but I have a little confusion about prg6 which is
ReplyDeletemain()
{
show();
}
void show()
{
printf("I'm the greatest");
}
It is written over there that it gives error but it does not when I run it on DevC++.Is this because of different compiler or what?