10 CLS
20 N = 10
30 DIM A(1 TO N) AS INTEGER
40 A(1) = 10
50 A(2) = 9
60 A(3) = 3
70 A(4) = 4
80 A(5) = 5
90 A(6) = 6
100 A(7) = 7
120 A(8) = 10
130 A(9) = 9
140 A(10) = 8
150 PRINT "ELEMENTS BEFORE SORTING"
160 FOR I = 1 TO N
    170 PRINT A(I)
180 NEXT I
190 LET COUNT = 0
200 FOR K = 1 TO (N - 1)

    210 LET PTR = 1
    220 WHILE (PTR <= N - K)
        230 IF A(PTR) > A(PTR + 1) THEN
            240 HOLDER = A(PTR)
            250 A(PTR) = A(PTR + 1)
            260 A(PTR + 1) = HOLDER
            270 LET COUNT = COUNT + 1
        280 END IF
        290 LET PTR = PTR + 1
    300 WEND
310 NEXT K
320 PRINT "ELEMENTS AFTER SORTING"
330 SUM = 0
340 FOR J = 1 TO N
    350 PRINT A(J)
    360 SUM = SUM + A(J)
370 NEXT J
380 PRINT "THE ARITHMETIC MEAN OF THE SORTED 10 NUMBERS IS ", SUM / 10

390 END

PROGRAM RESULT