fun with test arrays. Range tests. | Sololearn: Learn to code for FREE!

0

fun with test arrays. Range tests.

if input belongs to first 5th range of the numbers array 'inc' - print this number and 'out's range that starting from that 5th element till the end. int in = 5;//get input. in[] inc = new int{"1","2", "3","4", "5","6", "7","8", "9","10", "11","12", "13","14", "15","16", "17","18", "19","20" }; int[] out = new int{ "30","31", "32","33", "34","35", "36","37", "38","39","40"}; //add/remove elements. if(in<=5){ ~ for(){~} }

4/5/2018 5:03:18 PM

Rifat

1 Answer

New Answer

+1

Try and add the numbers to inc and out with for loops instead. It'll make the code more readable and you can easily add a different amount of numbers by just editing the for loop(s).