Write a program to find the sum of all natural numbers from 1 to n using for loop in java
Pls show the tracing
Answers
Answered by
0
Answer:
Directly adding them you get the sum as 55. Also, using the formula [a=n*(n-1)/2], where a is the sum of the natural numbers, n=10 as integers from 1–10 are natural numbers and we need to find the sum of first 10 natural numbers, we get the sum as 55. Answer is 55. 55.
Similar questions