I was assisting a student with a question about for loops, essentially you have 2 numbers x and y and you want to sum every value from x to y together to get a total. For example 5 to 10 would print 45 (5+6+7+8+9+10). While helping this person I decided to write the program recursively for some practice and noticed that my recursive method wasn’t returning 45, instead it just keeps returning 5. If anyone could explain to me what’s going on I’d appreciate it! Thanks!

```
public class forLoops {
public static void main(String[] args) {
int sum = calc(5,10);
System.out.println(sum);
}
public static int calc(int num1, int num2) {
int sum = calc(num1, num2, 0 );
return sum;
}
public static int calc(int num1, int num2, int total) {
if(num1 <= num2)
{
total += num1;
num1++;
System.out.println(num1);
calc(num1, num2,total);
}
return total;
}
}
```