I need to write a program that reads 3 real numbers (not only integers) from the console and prints their sum in C#.

Examples:

 a b c sum 3 4 11 18 -2 0 3 1 5.5 4.5 20.1 30.1

+1 vote

The main thing you should do is to first parse (or convert) the strings to integers (in this case doubles) because Console.ReadLine(); reads only string values.

Here's the code:

```using System;

class SumOfThreeNumbers
{
static void Main()
{
double numberOneP = double.Parse(numberOne);

double numberTwoP = double.Parse(numberTwo);

double numberThreeP = double.Parse(numberThree);
Console.WriteLine("The sum of the three numbers is: " + (numberOneP+numberTwoP+numberThreeP));

}
}
```
edited by user golearnweb
+1 vote

Or this one:

```using System;

class Sum
{
static void Main()
{

Console.WriteLine("Sum of these numbers is " + (firstNumber + secondNumber + thirdNumber));

}
}```

edited by user golearnweb
+1 vote

Or this solution (decimal instead of double - as it includes bigger range of numbers):

```using System;

namespace ConsoleInputOutput
{
public static class SumOfThree
{
public static void Main()
{