write a program in Q Basic to read n numbers from the keyboard and find out the largest and lowest numbers among them
Answers
Answered by
0
Answer:
CLS
DIM A(10)
INPUT "ENTER THE VALUE OF N"; N
FOR I=0 TO N
INPUT A(I)
NEXT I
PRINT "THE VALUE IN ARRAY"
FOR I=0 TO N
PRINT A(I)
NEXT I
MAX=A(0)
MIN=A(0)
FOR I=0 TO N
IF A(I)>MAX THEN
MAX=A(I)
END IF
IF A(I)<MIN THEN
MIN=A(I)
END IF
NEXT I
PRINT "THE LARGEST NUMBER";MAX
PRINT "THE LOWEST NUMBER ";MIN
END
Similar questions