Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- using System.Globalization;
- class SumOfNumes
- {
- static void Main()
- {
- //Write a program that reads 3 real numbers from the console and prints their sum.
- Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
- Console.Write("Enter the First number: ");
- double a = double.Parse(Console.ReadLine());
- Console.Write("Enter the Second number: ");
- double b = double.Parse(Console.ReadLine());
- Console.Write("Enter the Third number: ");
- double c = double.Parse(Console.ReadLine());
- Console.WriteLine("The sum of these numbers is: " + "{0} + {1} + {2} = {3}", a, b, c, a + b + c);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment