C#, absolute beginner getting CS1513 C# } expected error

前端 未结 5 715
深忆病人
深忆病人 2021-01-29 08:52

This is my very first day of programming without having any programming background. I was trying the below code. Please click the below link for the screenshot.

CS1513

5条回答
  •  失恋的感觉
    2021-01-29 09:38

    You have a stray semicolon after your if statement. Because of that, the compiler sees your braces as just defining a random block of code (which is valid) but it doesn't understand why you have an else after that.

提交回复
热议问题