Reason is checked is a keyword in C#,but if u want to keyword as an identifier use @ with it.e.g int @checked=3; This works with all the keywords,but it is recommended to avoid it.
Checked and UnChecked is keyword in C# used to control the overflow-checking contex for integral type arithemetic operations and conversions. it can be used as an operator or a statement.
RE: Why do I get a syntax error when trying to declare a variable called checked?
Reason is checked is a keyword in C# but if u want to keyword as an identifier use @ with it.e.g int @checked 3; This works with all the keywords but it is recommended to avoid it.