summation in java using for loops
I am trying to make a summation calculator for the following equation:
Where i is the lower limit (in this case it will always be 0) and n is the upper limit (in this problem the user will be asked to enter an integer value of the upper limit).
Here is my code (so far):
public class summation
public static void main(String args) throws IOException
BufferedReader keybd = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter the upper limit: ");
ul = Integer.parseInt(keybd.readLine());
I don't understand how to use a for loop to calculate the sum.
After that I got stuck. I appreciate any help i can get thanks! :)