Tuesday, April 2, 2013

Pascal: Structure of branch condition IF .. THEN .. ELSE


/ / Calculate the square root of two of several
PROGRAM IF_ELSE_DEMO;
VAR
            a: Real;
BEGIN
            Write ('Enter the number of a =');
            Readln (a);
            IF a <0 THEN Write ('a: 10: 2, negative numbers should not take the!!!')
            ELSE
                  Writeln ('The number of level 2, a: 2: 2, la, SQRT (a): 10: 3');
            Readln; {Pause screen to view the results}
END.

No comments:

Post a Comment