Tuesday, October 25, 2011

Qbasic (Input 10 different marks and find greatest)

Declare Sub res(n())
CLS
DIM N(10)
PRINT "ENTER MARKS OF TEN STUDENTS"
FOR I = 1 TO 10
INPUT N(I)
NEXT
CALL RES(N())
END

SUB RES(N())
LET G = N(1)
FOR I = 2 TO 10
IF G<N(I) THEN G = N(I)
NEXT
PRINT "GREATEST MARKS IS"; G
END SUB

No comments:

Post a Comment