7.3.. Napisati program za izračunavanje y na osnovu vrijednosti x:

Listing programa:


PROGRAM p07311020;
USES
  WinCrt;
VAR
  x : 1..5;
  y : Real;
BEGIN
  Write('Koeficijent (1 5)');
  Readln(x);
  CASE x OF
    1 : y := x + 2;
    2 : y := x - 2;
    3 : y := x / 2;
    4 : y := x -5;
    5 : y := 2 - x;
  END;
  Writeln('x = ', x, '  y = ', y);
END.

Ispis na ekranu:

Index