Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
588 B
7
Indexable
program TableOfValues;

var
  a, b, x, y: real;
  step: real;
  i: integer;

begin
  writeln('Enter the value of a: ');
  readln(a);
  writeln('Enter the value of b: ');
  readln(b);
  writeln('Enter the step size: ');
  readln(step);

  writeln('-------------------------');
  writeln('   x      |      y');
  writeln('-------------------------');

  x := a;
  while x <= b do
  begin
    y := 2 + ((3 * x) * (3 * x) * (3 * x) - 7) / x;
    writeln(x:8:2, '  |  ', y:8:2);
    x := x + step;
  end;
  writeln('----------------------------------------');
end.