Friday, October 15, 2021

To generate the given pattern C CO COM COMP COMPU COMPUT COMPUTE COMPUTER (QBASIC Coder)

OUTPUT
CLS
X$ = "COMPUTER"
FOR i = 1 TO LEN(X$)
     PRINT LEFT$(X$, i)
NEXT i
END


Using SUB Procedure

DECLARE SUB pattern(a$)
CLS
x$ = "COMPUTER"
CALL pattern(x$)
END

SUB pattern (a$)
FOR i = 1 TO LEN(a$)
     PRINT LEFT$(a$, i)
NEXT i
END SUB


Using FUNCTION Procedure

DECLARE FUNCTION pattern()
CLS
d = pattern(x$)
END

FUNCTION pattern (a$)
a$ = "COMPUTER"
FOR i = 1 TO LEN(a$)
     PRINT LEFT$(a$, i)
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...