Need to correct answer What is contained in the array foo at
Need to correct answer
What is contained in the array foo at the end of execution? BDF234 BCF223 DCH153 CCG456Solution
Answer: C) DCH153
Explanation:
In line 3, we assigned ACE123 value to array foo.
Now foo array holding value ACE123.
in line 4, we assigned foo array to p pointer variable. Now p variable value is ACE123.
in while condtion, we are running loop up to the size of an foo array. So it is 6.
In side while loop, at line 7, we are adding 3 to *p.
it means *p here is p[0]. p[0] value is A. adding 3 means 3 characters so p[0] now is D
at line 8 we are adding p variable 2. it means we are adding 2 value to the index.
Now index is 2. p[2] is E. Again 3 characters will add and store H value in p[2].
like this, loop will iterate up to index > size of foo array.
So finally foo array will have value DCH153.
