WAP to print fibonacci series upto nth terms using sub .... end sub.
1 Answer
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
-
Who is a system analyst? What are the characteristics of system analysts? 1
-
What are the different stages of the system development life cycle (SDLC) 1
-
What do you understand about AI? What are the negative and positive aspects of AI in society? 1
-
How does an AI application work? Can a computer really think with the aid of AI? 1