Thursday, October 17, 2019

144. Qbasic to generate the string pattern given below: E V E R E S T V E R E S E R E R


144.      Write a SUB procedure  to generate the string pattern given below:
E V E R E S T
   V E R E S
       E R E
                                  R

DECLARE SUB PATTERN (S$)
CLS
S$ = "EVEREST"
CALL PATTERN(S$)
END

SUB PATTERN (S$)
A = 1
FOR I = LEN(S$) TO 1 STEP -2
PRINT TAB(A); MID$(S$, A, I)
A = A + 1
NEXT I
END SUB

1 comment: