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

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!