Wednesday 25 March 2020

STRING PATTERNS By using FUNCTION.....END FUNCTION

STRING PATTERNS


FUNCTION.....END FUNCTION

*SCIENCE*
*CIENC*
*IEN*
*E*


DECLARE FUNCTION a$(n$,I,B)
CLS
B=1
n$="SCIENCE"
FOR I=LEN(N$) TO 1 STEP -2
PRINT TAB(B);"*";A$(N$,I,B);"*"
B=B+1
NEXT I
FUNCTION A$(N$,I,B)
A$=MID$(N$,B,I)
END FUNCTION


B.
C
COM
COMPU
COMPUTE
COMPUTERS


DECLARE FUNCTION A$(N$,I)
CLS
N$="COMPUTERS"
FOR I=1 TO LEN(N$) STEP 2
PRINT A$(N$,I)
NEXT I
END
FUNCTION A$(N$,I)
A$=LEFT$(N$,I)END FUNTION
SHARE


No comments:

Post a Comment

MCQ Question Bank Microsoft PowerPoint