about summary refs log tree commit diff
path: root/usth/MATH2.4/hw/linear
blob: fad7e6727773705fccd778e51098a61a5592e21b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env octave
disp ("Solve quadratic equation ax + b = 0");
a = input ("a = ");
while (a == 0)
  disp ("a must be nonzero");
  a = input ("a = ");
end
b = input ("b = ");

disp ("The two solutions of the given linear equation is:");
x = -b / a