• Lenguaje

    Pascal

  • Descripción

    Evalúa la función:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
program FuncionX21X23X;
uses crt;

var x, y : real;
begin
    write ('Ingresa el valor de x: ');
    readln (x);
    y := 0;
    if x<-3 then
        begin
            y := x*x-1;
        end;
    if (x>=-1) and (x<8) then
        begin
            y := x-2;
        end;
    if x>=8 then
        begin
            y := 3.0-x;
        end;
    writeln ('Valor de y: ', y:0:6);
    writeln;
    write ('Presiona una tecla para terminar . . . ');
    readkey;
end.