online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/****************************************************************************** © ProgrammeraJava.se *******************************************************************************/ public class Main{ private static int summa (int N) { int sum; // hjälpvariabel if (N == 1) { // basfall sum = 1; } else { sum = N + summa(N - 1); // Metoden anropar sig själv --> Rekursivt anrop } return sum; //Returnera summan } public static void main(String[] args) { System.out.println(summa(4)); //Skriv ut summan av alla heltal mellan 1 och 10 System.out.println(summa(10)); //Skriv ut summan av alla heltal mellan 1 och 10 System.out.println(summa(1)); //Basfallet } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue