To print the sum of the first 10 odd numbers. (Qbasic Code)

REM To print the sum of the first 10 odd numbers. (Qbasic Code)

CLS
s = 0
a = 2
FOR I = 1 TO 10
    s = s + a
    a = a + 2
NEXT I
PRINT "Sum of square of first 10 odd numbers ="; s
END

Share :

X
Back To Top

facebook main

Powered by Blogger.