Advertisement
ajreuri23

מחשבון משוואה ריבועית

Oct 7th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. double a, b, c, d, e, f, g;
  2. Console.Write("Insert a: ");
  3. a = double.Parse(Console.ReadLine());
  4. Console.Write("Insert b: ");
  5. b = double.Parse(Console.ReadLine());
  6. Console.Write("Insert c: ");
  7. c = double.Parse(Console.ReadLine());
  8. e = -4 * a * c;
  9. f = b * b;
  10. g = 2 * a;
  11. d = Math.Sqrt(f + e);
  12. Console.WriteLine ((-b + d)/g);
  13. Console.WriteLine ((-b - d)/g);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement