i'm a c++ beginner.. how to add everything by 1 except arr2[1].. i want arr2[1] to remain the same..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
int arr []= {6,6,6};
int arr2 [] = {6,0,6,6};
cout << arr[0] << arr[1] << arr[2] << arr2[0] << arr2 [1] << arr2[2] << arr2[3] ;
arr[0] = seeds;
int j=0;
for (int i = 0; i <seeds; i++)
{
if (i <=2)
{ arr[i] +=1;}
if (i >2)
{ arr2[j] +=1}
}
|
i don't know how to skip arr2[1] and continue adding at arr[2] :(
Last edited on