Question: Java Program: Write a recursive method to compute 1 + 2 + ... + n, the nth triangle number. Given an integer parameter n, your
Java Program: Write a recursive method to compute 1 + 2 + ... + n, the nth triangle number. Given an integer parameter n, your method should return the nth triangle number.
Write a main method to test your recursive. Your main method accepts a user supplied integer n and generates and displays the first n triangle numbers.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
