Please explain where the code fails.Pcycle
Initialize length to 0 first. Otherwise it stores junk value initially.
As you will notice your length is the only thing wrong.
Initialize length to 0 first. Otherwise it stores junk value initially.
As you will notice your length is the only thing wrong.