Zeeshan AliNoxiee wrote:I am trying to print a loop inside an array of a greater size than the loop itself.
Like for example I have an array of size 7 but it has only 3 elements.
No, it has 7 elements but only 3 of them are values you have inserted.
To iterate over the elements you have inserted rather than the whole array you can either keep track of the number of values you have inserted or initially fill the array with an invalid value (eg -1) and iterate until you find an invalid value.
Zeeshan AliNoxiee wrote:
now what I want to do is print these three numbers in a loop so that my array[3]=2;array[4]=3;array[5]=4 ...... till the last one.
Sorry but I don't know what you mean by this. You talk of printing the values but then show what looks like a copy of the elements to other elements in the array. Please explain clearly what you are trying to achieve