What will be the contents of the a array after the following statements are executed? [8] int a[MaxSize] ={9,2,21,10,12,
Posted: Fri Apr 29, 2022 6:33 am
What will be the contents of the a array after the following
statements are executed?
[8] int a[MaxSize] ={9,2,21,10,12,6,5,8,17};
int *p=&a[0],*q;
q = p+MaxSize-1;
; int solution = 0;
while(p<=q)
{
solution += *p%2 == 0?
*p: 0; p++;
}
statements are executed?
[8] int a[MaxSize] ={9,2,21,10,12,6,5,8,17};
int *p=&a[0],*q;
q = p+MaxSize-1;
; int solution = 0;
while(p<=q)
{
solution += *p%2 == 0?
*p: 0; p++;
}