write a program in Qbasic to enter 20 different numbers from the console. display the maximum and the minimum number among the given set of numbers
Answers
Answered by
0
Answer:
CLS
DIM A(20)
PRINT "ENTER THE VALUE "
FOR I=1 TO 20
INPUT A(I)
NEXT I
PRINT "THE VALU LE ARE "
FOR I=1 TO 20
PRINT A(I)
NEXT I
MAX=A(0)
MIN =A(0)
FOR I=1 TO 20
IF A(I)>MAX THEN
MAX=A(I)
END IF
NEXT I
FOR I=1 TO 20
IF A(I)<MIN THEN
MIN=A(I)
END IF
NEXT I
PRINT "MAXIMUM ELEMENT "; A(I)
PRINT "MINIMUM ELEMENT "; A(I)
END
Similar questions
Math,
5 months ago
Political Science,
5 months ago
English,
9 months ago
English,
9 months ago
English,
1 year ago