PRACTICAL-3
OBJECT: Write a program to produce
the sum of first Ten Natural Numbers
10 REM * PROGRAM TO
PRODUCE SUM OF NUMBERS *
20 CLS
30 PRINT “NUMBERS”
40 PRINT
“~~~~~~~~~”
50 FOR N = 1 TO 10
60 SUM = SUM +
N
70 PRINT N
80 NEXT N
90 PRINT TAB(30); “---------“
100 PRINT “SUM OF
FIRST TEN NATURAL NUMBERS IS “;SUM
110 PRINT TAB(30); “---------“
|
0 comments:
Post a Comment