My code returns this error:
ERROR! Unhandled Exception: StackOverflowException [ERROR] FATAL UNHANDLED EXCEPTION: System.StackOverflowException: The requested operation caused a stack overflow. at HelloWorld.x (System.Int32 y) <0x41e36180 + 0x00004> in <0e1357c43db845f2b6acb041d1724d28>:0 at HelloWorld.x (System.Int32 y) [0x00001] in <0e1357c43db845f2b6acb041d1724d28>:0 at HelloWorld.x (System.Int32 y) [0x00001] in <0e1357c43db845f2b6acb041d1724d28>:0 at HelloWorld.x (System.Int32 y) [0x00001] in at HelloWorld.x (System.Int32 y) [0x00001] in <0e1357c43db845f2b6acb041d1724d28>:0 at HelloWorld.x (System.Int32 y) [0x00001] in <0e1357c43db845f2b6acb041d1724d28>:0 at HelloWorld.x (System.Int32 y) [0x00001] in
[...]
<0e1357c43db845f2b6acb041d1724d28>:0 at HelloWorld.x (System.Int32 y) [0x00001] in <0e1357c43db845f2b6acb041d1724d28>:0 at HelloWorld.x (System.Int32 y) [0x00001] in <0e1357c43db845f2b6acb041d1724d28>:0 at HelloWorld.x (System.Int32 y) [0x00001] in <0e1357c43db845f2b6acb041d1724d28>:0 at HelloWorld.x (System.Int32 y) [0 etc...
I tried everything i swear and nothing worked.
My code:
using System;
public class HelloWorld
{
static int x(int y)
{
return x(y)*x(y)+y;
}
public static void Main(string[] args)
{
Console.WriteLine (x(1));
}
}