Question: public static void main(String[] args) { fun(4); } public static void fun(int n){ if(n>0) { fun(n-1); System.out.printf(%d,n); fun(n-1); } } } OUTPUT: 121312141213121 IT'S A

public static void main(String[] args) { fun(4); } public static void fun(int n){ if(n>0) { fun(n-1); System.out.printf("%d",n); fun(n-1); } } }

OUTPUT: 121312141213121

IT'S A JAVA CODE. CAN YOU EXPLAIN WHY THE OUTPUT IS THAT HOW IT WORKS?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!