Why do we write endif statement in this program? Without writing it, we can easily get our result. Is there any example through which you can explain me the use of endif statement?
I have tried this:
INPUT X
IF X>10 THEN PRINT "X IS GREATER THAN 10" ELSE PRINT "X IS NOT GREATER THAN 10"
END
then I am also getting expected result.
The real code is:
INPUT X
IF X>10 THEN
PRINT "X IS GREATER THAN 10"
ELSE
PRINT "X IS NOT GREATER THAN 10"
END IF
END
EXPECTED AND DESIRED
FOR EXAMPLE:
WhenX=5then output will be "XIS NOT GREATER THAN10".
Aucun commentaire:
Enregistrer un commentaire