Why this C# code is not working? (Beginner)

    class Program
    {
        static void Main(string[] args)
        {
            Çonsole.Write("Enter a number; ");
            double num1 = Convert.ToDouble(Console.ReadLine());

            Console.Write("Enter Operator: ");
            string op = Console.ReadLine();

            Çonsole.Write("Enter a number; ");
            double num2 = Convert.ToDouble(Console.ReadLine());

            if (op == "+") 
            {
                Console.Writeline(num1 + num2);
            } else if (op == "-")
            {
                Console.WriteLine(num1 - num2);
            }
            else if (op == "/")
            {
                Console.WriteLine(num1 / num2);
            }
            else if (op == "*")
            {
                Console.WriteLine(num1 * num2);
            }
            else
            {
                Console.Writeline("Invalid Operator");
            }

 Console.ReadLine();

        }
    }
}

Thanks :slight_smile:

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.

markdown_Forums

Thanks for explaining me that :slight_smile:

You have mistype Console.Write. You used a special character Ç

1 Like

Wooow :slight_smile: I dont know how that happened…