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

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
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

This note was uploaded on 10/02/2011 for the course ME 205 taught by Professor Koen during the Spring '07 term at University of Texas at Austin.

Page1 / 5

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

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online