Thursday, October 14, 2021

QBASIC Program to print the pattern 1, 11, 111, 1111, 11111 (SUB/FUNCTION)

OUTPUT
CLS
n = 1
FOR i = 1 TO 5
     PRINT n
     n = n * 10 + 1
NEXT i
END


Using SUB Procedure

DECLARE SUB pat()
CLS
CALL pat
END

SUB pat
n = 1
FOR i = 1 TO 5
     PRINT n
     n = n * 10 + 1
NEXT i
END SUB


Using FUNCTION Procedure

DECLARE FUNCTION pat()
CLS
d = pat
END

FUNCTION pat
n = 1
FOR i = 1 TO 5
     PRINT n
     n = n * 10 + 1
NEXT i
END FUNCTION

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...