Given this declaration, answer the following: int item [25], amount [25], a; a) if a = 8, what array element is referred to by the item [a-3]? b) if a is 24, what element is amount (a+1]?
Answers
Answered by
0
(a.) item[a-3] = item[8-3] = item[5]
So item[5] will be sixth element of an array 'item'
(b.) amount[a+1] = amount[24+1] = amount[25]
So amount[25] will be 26th element of 'amount'
But array amount[25] will show a garbage value because we have iniliaze 'amount' array with 25 elements.
So item[5] will be sixth element of an array 'item'
(b.) amount[a+1] = amount[24+1] = amount[25]
So amount[25] will be 26th element of 'amount'
But array amount[25] will show a garbage value because we have iniliaze 'amount' array with 25 elements.
Answered by
0
The C Programming array can be defined as number of memory which can store the same data type and references through the same variable name.
In addition, there are more number of collection of similar elements as well as integers or all floats or all characters etc.
Moreover, the array must be of the same type of 5 are float.
Similar questions