Modified forStmtCodeGen

Added check using the exclude flag which defines whether the stop value  has to be excluded .