Saturday, October 2, 2021

QBASIC Program to print the series 1, 27, 125, 343, 729

Using FOR...NEXT
CLS
n = 1
FOR i = 1 TO 5
      PRINT n ^ 3;
      n = n + 2
NEXT i
END


Using WHILE...WEND

CLS
n = 1
i = 1
WHILE i <= 5
      PRINT n ^ 3;
      n = n + 2
      i = i + 1
WEND
END


Using DO ... LOOP

CLS
n = 1
i = 1
DO
      PRINT n ^ 3;
      n = n + 2
      i = i + 1
LOOP WHILE i <= 5
END


No comments:

Post a Comment

If you have any doubts, Please let me know.

[Download PDF] Computer Science Book Gread-10 in Nepali Language

 If you are searching for class 10 Computer Science in Nepali pdf for free download then you are at the right page. This book is soley publi...