when the main routine is executedthe first activation record is created and pushed onto the run time stackas illustrated in figure (awhen the factorial function is calledthe second activation record is created and pushed onto the stackas illustrated in figure ( )and the flow of execution is changed to that function fact( )return to main(nmain()return address ypush push record main()return address yrecord ( (bfigure the initial run time stack for the sample code segment the factorial function is recursively called until the base case is reached with value of at this pointthe run time stack contains four activation recordsas illustrated figure (awhen the base case statement at line of listing is executedthe activation record for the function call fact( is popped from the stackas illustrated in figure ( )and execution returns to the function instance fact( this process continues until all of the activation records have been popped from the stack and the program terminates fact( )return to fact( fact( )return to fact( npop record fact( )return to fact( fact( )return to main(nfact( turn to re fact( fact( )return to main( main()return address main()return address ( (bfigure the run time stack for the sample program when the base case is reached