This example finds the sum of all numbers till a given input number using for Loop In Java. e.g., if the input is
6 , then the sum is 1 + 2 + 3 + 4 + 5 + 6 = 21;
Sum of numbers CODE class SumOfNumbers OUTPUT Sum after adding 1 is : 1 DESCRIPTION The program calculates the sum of numbers till the given THINGS TO TRY
|