Computer Science, asked by geetanjalikarmakar52, 8 months ago

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 AnindaBasu
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