View the step-by-step solution to:

# Spring CPS 196 Lab 9: Date / / 10 2010 Introduction to Computer Programming Using C Name:...

question I and II in attachment

Spring CPS 196 Lab 9: Date / / 10 2010 Introduction to Computer Programming Using C Name: ________________________________________________________________________ Andrew C. Lee EECS, Syracuse University 1 Introduction to Arrays and Functions II: Basic Array Manipulations The following two examples illustrate the basic techniques for the manipulation of one dimensional and two dimensional arrays. Base on the ideas you obtained from our class discussions, complete the following tasks. I. Manipulation of one dimensional arrays The following is an outline of the program firstarray.c. Base on these outline, write a program which completes the work as specified in the outline. 1. Step 1: Declare a global constant SIZE which is set to 5 2. Step 2: Create two arrays: a. Array 1: an integer array named myIntArr; b. Array 2: a character array named myCharArr; Both arrays are of length = SIZE. 3. Step 3: Use for loops to initialize both arrays 4. Step 4: For each index i, myIntArr[i] will store 2i. 5. Step 5: The character array will store the word “GREAT” 6. Step 6: Print the contents for both arrays to verify the answers. 7. Step 7: Modify the integer array so that myIntArr[i] will store a 0 if i is odd and will store a1 if i is even. 8. Step 8: Modify the character array so that it will now store “WORK!”. 9. Step 9: Print the contents for both arrays to verify the answers. To complete this section, hand in a program listing of your work together with sample run(s) of your code. II. Manipulation of an two dimensional array In this section, you are asked to write a C program which will create a four by four arrays of integers, initialize all the entries to be zero and print it to the screen neatly on a two dimensional grid. To complete this section, you need to hand in a plan for your implementation, a program listing of your implementation file and a sample run.

### Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

### -

Educational Resources
• ### -

Study Documents

Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

Browse Documents