#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int x [5] ={2,2,1,3,1,};
int y;
y=x[1]+1;
cout<<y<<endl;
x[4]=1;
cout <<x[x[4]]<<endl;// Explain how this printed 2 ?
y--;
cout<<y<< " "<<x[y]<<endl;
return 0;
}
/*
the answer is
3
2 // why is it 2 here?
2 1
i looked at the x[4] which hold 1
*/
Last edited on