WAP to find/print smallest number among 10 numbers without using array

Qbasic program to find/print smallest number among 10 numbers without using array



CLS
 INPUT "ENTER FIRST NUMBER"; N
 FOR I = 2 TO 10
 INPUT "ENTER NEXT NUMBER"; S
 IF S < N THEN N = S
 NEXT I
 PRINT "THE SMALLEST NUMBER IS "; N
 END

USING SUB


DECLARE SUB SMALL(N)
 CLS
 INPUT "ENTER FIRST NUMBER"; N
 CALL SMALL(N)
 END
 
 SUB SMALL(N)
 FOR I = 2 TO 10
 INPUT "ENTER NEXT NUMBER"; S
 IF S < N THEN N = S
 NEXT I
 PRINT "THE SMALLEST NUMBER IS "; N
 END SUB

Post a Comment

0 Comments