Home / C Programming / Functions :: Discussion

Discussion :: Functions

  1. Which of the following statements are correct about the program?

    #include 
    
     int main()
     {
         printf("%p\n", main());   
         return 0; 
     } 

     

  2. A.

    It prints garbage values infinitely

    B.

    Runs infinitely without printing anything

    C.

    Error: main() cannot be called inside printf()

    D.

    No Error and print nothing

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    In printf("%p\n", main()); it calls the main() function and then it repeats infinetly, untill stack overflow.


Be The First To Comment