"Invalid token '{' in class, struct, or interface member declaration"

c#, token

Solution

There is error because you have semicolon in there and there is wrong variable name, fix:

void add(int x, int y)
{
    int c= x+y;
    Console.WriteLine("addition is " + c);
}

Problem

I get the error "Invalid token '{' in class, struct, or interface member declaration" in my following C # code. ``` using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication3 { class Program { static int a, b; void add(int x, int y); { int c= x+y; Console.WriteLine("addition is " + char); } static void Main(string[] args) { } } } ``` Your help in solving will be greatly appreciated. Thank you. Anees

Original source