PRACTICAL-5
OBJECT: (a) Write a generalized program
to prepare a Multiplication Table up till ten times
10 REM * PROGRAM TO
PREPARE MULTIPLICATION TABLE *
20 CLS
30 INPUT “NUMBER FOR TABLE”; N
40 CLS
50 PRINT “TABLE OF
……………:”; N
60 PRINT
70 FOR M = 1
TO 10
80 PRINT N; “*”; M; “ = “; N * M
90 NEXT M
100 END
|
(b) Write
a generalized program to find the Average of given four numbers.
10 REM * PROGRAM TO
FIND THE AVERAGE OF NUMBERS *
20 CLS
30 INPUT “ENTER FIRST NUMBER----------- ”; N1
40 INPUT “ENTER SECOND NUMBER------- ”; N2
50 INPUT “ENTER THIRD NUMBER---------- ”; N3
60 INPUT “ENTER FOURTH NUMBER------- ”; N4
70 AVG = (N1 + N2 +
N3 + N4) / 4
80 PRINT TAB(25)“FIRST NUMBER--------------- ”; N1
90 PRINT TAB(25)“SECOND NUMBER----------- ”; N2
100 PRINT TAB(25)“THIRD NUMBER-------------- ”; N3
110 PRINT TAB(25)“FOURTH NUMBER----------- ”; N4
120 PRINT
130 PRINT TAB(25)“AVERAGE OF FOUR NUMBERS----“; AVG
140 END
|
0 comments:
Post a Comment