Code:
for(i=98;i>=50;i--)
for(j=99;j>=51;j--)
FYI- That's a nested loop. Very handy, but not for this problem. You do NOT need two indexes (i & j).
All you need is i and i+1. (Or i and i-1, depending on how you write your program.
This is NOT a program fragment... just some random C++ statements for you to think about!
Code:
data[99] = data[98]; // Copy value from data[98] to data[99]
// Both now have the same value
data[98] = data[97]; // Copy value from data[97] to data[98]
data[97+1] = data[97]; // Same as above
data[i+1] = data[i]; // Copy value from data[i] to data[i+1]
When your loop is done shifting, data[50] and data[51] will have the same value. Then, you can overwrite data[50] with the new value.