here' some sample outputenter number triangle incidentallyif you're skeptical of the results returned from triangle()you can check them by using the following formulanth triangular number ( + )/ what' really happeninglet' modify the triangle(method to provide an insight into what' happening when it executes we'll insert some output statements to keep track of the arguments and return valuespublic static int triangle(int nsystem out println("enteringn= )if( == system out println("returning ")return else int temp triangle( - )system out println("returning temp)return temphere' the interaction when this method is substituted for the earlier triangle(method and the user enters enter number enteringn= enteringn= enteringn= enteringn= enteringn= returning returning returning