Source of Question4.java


  1: public class Question4
  2: {
  3:     public static void main(String[] args)
  4:     {
  5:         System.out.println(mysteryValue(3));
  6:     }
  7:     public static int mysteryValue(int n)
  8:     {
  9:         if (n <= 1)
 10:             return 1;
 11:         else
 12:             return (mysteryValue(n - 1) + n);
 13:     }
 14: }