January 3, 2017

Qbasic program to print Fibonacci Series: 1, 1, 2, 3, 5, 8, 13 ....... up to 20th term.

CLS
A = 1
B = 1
PRINT A;
PRINT B;
FOR I = 1 TO 18
C = A + B
PRINT C;
A = B
B = C
NEXT I
END

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.