1.

Debug : CLS A = APPLE FOR X = 1 TO LEN$ (A$) PRINT RIGHT (X,A$) NEXT 1 END​

Answer»

Your Approach:

CLS

A = APPLE

FOR X = 1 TO LEN$ (A$)

PRINT RIGHT (X,A$)

NEXT 1

END

Where is the mistake?

  • Line no. 2 , A=APPLE , String should be enclosed with DOUBLE quotes ("") ALSO, for STORING string there should be $ symbol after variable name.
  • Line no. 3 It should be LEN() not LEN$()
  • Line no. 4 RIGHT$(A$,X) and string variable should come first in the parameter
  • Line no. 5 It should be Next I not Next 1

CORRECTED CÓDE:-

CLS

A$= "APPLE"

FOR X = 1 TO LEN (A$)

PRINT RIGHT$(A$,X)

NEXT I

END



Discussion

No Comment Found