C
C#12mo ago
McCormick

Top-Level statements must precede namespace and type declarations

No description
1 Reply
McCormick
McCormickOP12mo ago
public class TEst {
public int calc(int x, int y)
{
return x + y;
}

public void calc(int x, int y, out int area) { area = x + y; }
}



int res = new TEst().calc(10, 20);

int res2;

new TEst().calc(10, 20,out res2);

Console.WriteLine(res + res2);
public class TEst {
public int calc(int x, int y)
{
return x + y;
}

public void calc(int x, int y, out int area) { area = x + y; }
}



int res = new TEst().calc(10, 20);

int res2;

new TEst().calc(10, 20,out res2);

Console.WriteLine(res + res2);
What I did wrong? Thank you
public class TEst
{
public int calc(int x, int y)
{
return x + y;
}

public void calc(int x, int y, out int area) { area = x + y; }
}

class Program
{
static void Main()
{
int res = new TEst().calc(10, 20);

int res2;
new TEst().calc(10, 20, out res2);

Console.WriteLine(res + res2);
}
}
public class TEst
{
public int calc(int x, int y)
{
return x + y;
}

public void calc(int x, int y, out int area) { area = x + y; }
}

class Program
{
static void Main()
{
int res = new TEst().calc(10, 20);

int res2;
new TEst().calc(10, 20, out res2);

Console.WriteLine(res + res2);
}
}
Is that one good
Want results from more Discord servers?
Add your server