Wednesday, October 13, 2021

Qbasic Program to print 123454321, 1234321, 12321, 121, 1 [Hint: insert (;) at the end of PRINT a*a; to print in Horizontally] (SUB/Function)

OUTPUT


CLS
a = 11111
WHILE a <> 0
     PRINT a * a
     a = a \ 10
WEND
END


Using SUB Procedure

DECLARE SUB PATTERN()
CALL PATTERN
END

SUB PATTERN
     a = 11111
     WHILE a <> 0
          PRINT a * a
          a = a \ 10
     WEND
END SUB


Using FUNCTION Procedure

DECLARE FUNCTION PATTERN()
p = PATTERN
END

FUNCTION PATTERN
     a = 11111
     WHILE a <> 0
          PRINT a * a
          a = a \ 10
     WEND
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...