Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (anonymous):

Can't seem to understand what's wrong with this program :( #include void middle(int a[][10], int n) { int i,j; cout<<"Middle Column:- "; for(i=n/2,j=0; i>size; cout<<"Enter the elements of the matrix : "; for(int i=0; i>a[i][j]; } for(i=0; i

OpenStudy (anonymous):

can you give what error the compiler is giving....

OpenStudy (anonymous):

@aaddiittii

OpenStudy (rsmith6559):

With no specific error, that just leaves general principals. Personally, I wouldn't get so cute with variable scoping like you have in middle(). You're using the same variable names in both the inner and outer for loops. I'm not 100% sure that those are different variables. I'm not sure if the scope is the for block, or if the scope is the function block and the inner loop is making the outer loop behave wrong. I'm surprised that there isn't a: std.cout << endl; between the other two cout's in middle. To be thorough, the namespace isn't declared.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
2 days ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
2 days ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!