listing recursion continued class triangleapp static int thenumberpublic static void main(string[argsthrows ioexception system out print("enter number")thenumber getint()int theanswer triangle(thenumber)system out println("triangle="+theanswer)/end main(//public static int triangle(int nif( == return else returnn triangle( - )//public static string getstring(throws ioexception inputstreamreader isr new inputstreamreader(system in)bufferedreader br new bufferedreader(isr)string br readline()return //public static int getint(throws ioexception string getstring()return integer parseint( )///end class triangleapp ///////////////////////////////////////////////////////////////the main(routine prompts the user for value for ncalls triangle()and displays the return value the triangle(method calls itself repeatedly to do all the work