How can i get the numbers between 2 numbers?

i want to get numbers between 2 numbers.
i mean there is 2 numbers one is 1 and another one is 9.
then i want to get the all numbers between 1-9.

please help

What have you tried yourself?

2 Likes

sorry i didn’t tried anything because i don’t know what to use in that case ?

I think your best case would be to do highest number - lowest number = previous number and keep repeating that until it equals the lowest number.

To repeat, you’d do previous number - 1 = number lower than previous

3 Likes

@AryanGupta, you can use for loop to get the numbers between any two numbers.

Try this. If you feel it as better solution, mark this post as solution.

Keep koding. All the best.

3 Likes

image

10 Likes