In reply to Radheychin:
You’re constraining your randomisation to:
- Numbers divisible by 5
- Print in ascending order
You constrained the ascending order part but divisibility of 5 is not. Add that and you’d be fine, something like, foreach (var1[i]) var1[i] % 5 == 0.
Hope it helps… Cheers.