asked 112k views
1 vote
The sum of the numbers from 1 to n can be defined recursively as follows: the sum from 1 to 1 is 1. the sum from 1 to n is n more than the sum from 1 to n-1. write a int -method named sum that accepts an int parameter , n, and recursively calculates and returns the sum of the numbers from 1 to n. . submit

asked
User Jbiral
by
7.8k points

1 Answer

2 votes
1+2+3+... +n=
((1+n) x n) /2
is that the things you want
answered
User Kenial
by
8.7k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.