Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Test
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Please enter a number for a: ");
- double a = double.Parse(Console.ReadLine());
- Console.WriteLine("Please enter a number for b: ");
- double b = double.Parse(Console.ReadLine());
- Console.WriteLine("Please enter a number for c: ");
- double c = double.Parse(Console.ReadLine());
- double d = (b * b) - (4 * a * c);
- Console.WriteLine("x1: {0}", -(b + Math.Sqrt(d)) / (2 * a));
- Console.WriteLine("x2: {0}", -(b - Math.Sqrt(d)) / (2 * a));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment