Computer Science, asked by GG1408, 3 months ago

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

Answers

Answered by BrainlyProgrammer
7

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

Similar questions