Array hint

iam looking for help, I dont know how to work with array whre you have to ask the user the values. Example*******
Int main()
{
int xx [2] [3]={1,1,1,1,1,1};
for (int i=0;i<2;i++){
for (int j=0; j<3;j++)
cout<< xx [i] [j]<<' ';
cout<<endl;
}
return 0;
}//end main
the output of that code is:
1 1 1
1 1 1

My question is
if I dont initialize the array xx [2] [3] with all the 111111, and i have to ask the user the values, in what part of the code I have to do it and how many variable.
For example*****


let say I have 3 student and they have 3 test each
I DONT KNOW IF THIS IS CORRECT???????
int main()
{
int xx [3] [3] (dont know the values the user have to enter them)
int e1;
for (int i=0;i<3;i++)
for (int j=0; j<3; j++)
cout<<"enter the grades\n";
cin>>e1;
a [i] [j]=e1;
cout<<a [i] [j]<<' ';
cout<<endl;
}//end for
return 0;
}//end main
what i want to get if the notes of the first student was 100 90 85 and the second student 100 100 100 is
100 90 85
100 100 100

Please help me with that

thank you







I DONT KNOW IF THIS IS CORRECT???????

You can try it

By the way, you can directly get input in the array: cin >> a[i][j];
Topic archived. No new replies allowed.