2D_arrays - cin >> scores[row][col] }...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 // CMPSC 101 Ch. 5 Demo #13 #include <iostream> using namespace std int main() { int number = 0 int row int col int scores[5][3] for (row = 0 row < 5 row++) // inputing array values { for (col = 0 col < 3 col++) { cout << "Enter next score: "
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cin &gt;&gt; scores[row][col] } } // printing 2D array for (row = 0 row &lt; 5 row++) { for (col = 0 col &lt; 3 col++) { cout &lt;&lt; scores[row][col] &lt;&lt; '\t' } cout &lt;&lt; endl // advancing to next line } return 0 }// end of main...
View Full Document

This note was uploaded on 04/01/2008 for the course CMPSC 101 taught by Professor Drobish,renee during the Spring '07 term at Pennsylvania State University, University Park.

Ask a homework question - tutors are online