Computer Science, asked by TbiaSamishta, 1 year ago

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 Secondman
0

"a) When the value of 'a' is 8, the item [a-3] is item [5], then it refers to the value or element which is 6th in the array as the indexing starts from the first element 0.

b) When the value of a is 24 then the amount[a+1] becomes amount [25], then it refers to the last element, 26th element in the array as the indexing start from the element 0 which is the initial element."

Similar questions