hello guys:
i awais ahmad has a simple problem with the two dimensional array.
that is how to get two values in one column of the array

Sometimes when English isn't your native language it is even more difficult to explain what you want to do than it is for us native English speakers. To use multidiminsional arrays you can do something like this:

int array[2][2];

which declares a variable on the stack with enough memory for 4 ints. Now to get the information into that array you can do several things. Here's one way:

for(int i = 0; i < 2; ++i)
{
  for(int j = 0; j < 2; ++i)
 {
     cout <<"enter a value" << endl;
     cin >> array[i][j];
  }
}

and to dispay the values you use another nested loop except the body would be something like:

//pseudocode to display array as a table
for()
  for()
     cout << array[i][j] << ' ';  
  cout << endl;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.