2

I have a problem with Console.WriteLine()

When I try to print mathematical signs (+ , *) and other symbols (@, #, \, ~ , ;, ", '), I receive Unhadled.Exception: System.NullReferenceException.

If I insert a letter from the alphabet or a number everything is alright.

string expression = Console.ReadLine();

        foreach (char symbol in expression)
        {
            Console.WriteLine(symbol);
        }

Screenshot of NullReferenceException image 2 https://i.stack.imgur.com/buDRZ.png

Proof Image image 3 https://i.stack.imgur.com/IAL7y.jpg

zdzdz
  • 21
  • 3

0 Answers0