Friday 2 March 2012

QBasic-programs

How to print the largest of the three numbers?

CLS
INPUT "ino1:", ino1
INPUT "ino2:", ino2
INPUT "ino3:", ino3

IF ino1 > ino2 THEN
        IF ino1 > ino3 THEN
        imax = ino1
        PRINT imax
        ELSE
        imax = ino3
        PRINT imax
        END IF
ELSE
 IF ino2 > ino3 THEN
 imax = ino2
 PRINT imax
 ELSE
 imax = ino3
 PRINT imax
 END IF
END IF

No comments:

Post a Comment