Saturday, March 8, 2025

POSITIVE NEGATIVE ZERO CHECKING IN PROLOG

 POSITIVE NEGATIVE ZERO CHECKING IN PROLOG:

positive_negative_zero(A):-

    A > 0,

    write('Positive');

    A =:= 0,

    write('Zero');

    A < 0,

    write('Negative').


No comments:

Post a Comment