Practical#2
SOURCE PROGRAM
10 REM CALCULATE SQUARE AND CUBE OF FIRST TEN NATURAL NUMBERS
20 CLS
30 PRINT TAB(5) "NUMBERS", "SQUARES", "CUBE"
40 FOR N = 1 TO 10
50 LET S = N^2
60 LET C = N^3
70 PRINT TAB(5) N, S, C
80 NEXT N
90 END
OUTPUT
NUMBERS SQUARES CUBE
1 1 1
2 4 8
3 9 27
4 16 64
5 25 125
6 36 216
7 49 343
8 64 512
9 81 729
10 100 1000
Monday, April 12, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment