Computer Notes 2081
Computer Notes 2081
19. Rewrite the following program after correcting the bugs: 2 22. Re-write the following correcting the bugs:
16. Re-write the given program correcting the bugs: DECLARE SUB Series(.) DECLARE SUB CUBE(N)
DECLARE SUB Series() DLC CLS
CLS EXECUTE Series FOR I = 1 TO 5
EXECUTE Series END READ
END SUB Series CALL CUBE(No)
SUB Series REM to generate 2 2 4 6 10….. upto 10th term NEXT X
A=2 P=2 DATA 3, 5, 2, 6, 4
B=2 Q=2 END
FOR ctr= 1 to 5 FOR Ctr=1 TO 5 SUB CUBE( )
DISPLAY A;B; DISPLAY P,Q, DISPLAY N^3
A=A+B P=P+Q END SUB
B=A+B Q=P+Q
LOOP ctr WEND 23. Re-write the given program after correcting the bugs: [4×0.5=2]
END Series() END Series()
REM TO find the factorial of a given number.
17. Debug the given program: 20. Re-write the given program after correcting the bugs: DECLARE FUNCTION FACTO (N$)
DECLARE SUB Fibonic() DECLARE SUB FIBO ( ) CLS
REM *Fibonic series* CLS INPUT "Enter a number"; X
CALL SUB Fibonic EXECUTE FIBO PRINT "The Factorial is: ", FACTO (N)
END END END