-2

I'm new to programming and I'm trying to create a simple calculator program where I can add two different double values with each other. But I'm having this problem:

        Console.Write("First Number: ");
        double number1 = Convert.ToDouble(Console.ReadLine());

        Console.Write("Second Number: ");
        double number2 = Convert.ToDouble(Console.ReadLine());

        Console.WriteLine(number1 + number2);

For instance, let's say that I typed 10 and 2.5 I want the program to print out 12.5 but instead it prints out 35

-RESULT-

enter image description here

D Stanley
  • 144,385
  • 11
  • 166
  • 231

1 Answers1

-2

Try to write ',' instead '.' or change keyboard layout

Daniil
  • 1
  • 1
  • It was an issue with decimal separators. I tried using comma and it worked. Thanks everyone for helping out – Emirhan Sep 15 '21 at 18:49