{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Unit 08 Test

# Unit 08 Test - UNIT 8 TEST 1 Identify errors if any in each...

This preview shows pages 1–2. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: UNIT 8 TEST 1. Identify errors, if any, in each of the following array or function declarations. a. int a[4] = {0, 1, 2, 3, 4} ; b. int a[3][2] = { { 1, 2 }, { 3, 4 } , { 5, 6 } }; c. int a[3]; a[1] = 1; a[2] = 2; a[3]=3; d. int myFunction( int a, int rowSize, int ColumnSize); (it is okay to put more than one command on a line, just not good programming practice.) a) array (a[4]) has space for only 4 elements, but there are 5 ({0, 1, 2, 3, 4}) elements in the array. b)no error. c) array elements start with 0, or it should have been like this int a[3]; a[0] = 1; a[1] = 2; a[2]=3; . d)a should be before the two 's. e.g. int myFunction( int a, int rowSize, int ColumnSize); 2. Write a program that creates a 10 element array of integers using a constant value variable. Populate the array with random integers between 0 and 9. Then value variable....
View Full Document

{[ snackBarMessage ]}

### Page1 / 5

Unit 08 Test - UNIT 8 TEST 1 Identify errors if any in each...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online