I am trying to set an array’s slots using a for loop to be between specific numbers. For example, I want slot[0] to be set to 12 and slot[39] to be set to 52, and I want every slot between to be slot[0] and slot[39] to every number between 12 and 52; so it would be slot[0] = 12, slot[1] = 13, slot[14] = 14…etc.
Any suggestions?
declare the int array anf assign the value to it using for loop
try the following code