The one I posted on Nov23 will not sork. A slight modification. Below is the working code
"cobol ACCEPT WS-SYSIN-DATA FROM SYSIN
IF WS-SYSIN-NUM IS NUMERIC
C...
@vandita Just a minor correction
i think we should go till n-1 only so the in for loop it should be and should use i+1 since nbrs are starting from 1 and not 0