Some annoying C programs-Part II (Frequently Asked Question MUST READ)


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

  1. main()
    {
    static int var = 5;
    printf("%d ",var--);
    if(var)
    main();
    }
    Answer:
    5 4 3 2 1
    Explanation:
    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. 
Here we are providing you the frequently asked technical C question in different placement derives.So don't forget to read this pdf/word document.


FULL DOCUMENT IS HERE SO DOUBLE CLICK TO GET THIS PDF


DOWNLOAD PDF :   

IF BUTTON IS NOT WORKING THEN : CLICK HERE

1 comment:

  1. It was very informative but I have a little confusion about prg6 which is
    main()

    {

    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?

    ReplyDelete