Question: The questions below pertain to a single C program that manipulates arrays. Write declaration statements for the following: (i) (??) (a) An integer array termed,

 The questions below pertain to a single C program that manipulates

The questions below pertain to a single C program that manipulates arrays. Write declaration statements for the following: (i) (??) (a) An integer array termed, numl, with 10 cells. A 2D integer array termed, num2, with 2 rows and 10 columns. The first row of the array is initialized with "1,2,3,4,5,6,7,8,9,10". An integer variable i A character string termed, chi, initialized with "Teddy". (iii) (iv) Write a FOR loop that allows the user to key-in 10 integers, one at a time, and store them in array num1. Use variable i as the counter. (b) Write a WHILE loop that adds the contents from the first 6 cells of num2 and chl into the first 6 cells of numl, i.e. after the loop operation has ended, the first cell of numl will contain the addition of the first cell of numl, num2 and chl. The second cell of numl will contain the addition of the second cell of numl, num2 and chl...etc. Use variable i as the counter. You may assume that the variable i has already been set to 0. (c) (d) What will be stored in the first 6 cells of numl after the operation in part (c) has ended if the user keys-in all Os during the execution of the FOR loop in part (b)? (e) Assuming that each integer takes up 4 bytes for storage, what is the size (in terms of bytes) of array numl before and after the WHILE operation has ended in part (c)? Explain your

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!