REM a, b, n parameters represents first term, second term and number of terms respectively
DECLARE SUB fibo(a, b, n)
CLS
INPUT "First Term="; x
INPUT "Second Term=";y
REM label number is for data validation that length of terms must be less or equal to 20
10:
INPUT "How many terms="; z
IF z>20 THEN 10
CALL fibo(x, y, z)
END
SUB fibo(a, b, n)
PRINT a, b,
REM first two terms are already printed so started from 3
FOR I = 3 to n
s=a+b
PRINT s,
a=b
b=s
NEXT I
END SUB
can we generate same output using function procedure? If we can please let me know!
ReplyDeletegenerate given series plz
ReplyDelete1 2 3 4 = 10
5 6 7 8 = 26
9 10 11 12 = 42
------------
15 18 21 24
CLS
DeleteC=1
S=0
DO
PRINT C;
C=C+1
S=S+C
LOOP WHILE C<=4
PRINT"=";S
DO
PRINT C;
C=C+1
S=S+C
LOOP WHILE C<=8
PRINT "=";S
...........
LIKE WISE
Arigato DATTEVAYO
Delete1
ReplyDelete2 2
3 3 3
4 4 4 4
5 5 5 5 5
CLS
DeleteFOR I = 1 TO 5
FOR j = 1 TO I
PRINT I;
NEXT j
PRINT
NEXT I
1
ReplyDelete2 2
3 3 3
4 4 4 4
5 5 5 5 5
This comment has been removed by the author.
DeleteDeclare sub series (A,b)
DeleteCls
A=0
B=9
Call series (A,B)
END
SUB SERIES (A,B)
FOR I =1 TO 6
N=9
PRINT;
N=(N*10)+9
NEXT I
END SUM
YO PROGRAMMING YESARI GARNE HO 😊😊👍 TAR NUMBER ANUSAR HUNXA 😏
How to display acronym???
ReplyDeleterobin karki
Display "robin k"
dear sir can you print fibonacci using function procedure
ReplyDeleteHow to generate fibonacci series in qbasic with while loop
ReplyDeletedisplay the fibonacci series (1, 1, 2, 3, 5 upto 10th terms)
ReplyDeleteWAP to declare sub procedure to display fibonacci series of 1,1,2,3,5,8,.. up to 10 term
ReplyDelete