What would be the output of the following program int a[10]={0,1,2,3,4,5,6,7,8,9}; int *p; p = a; for (int i= 9; i>= 0;

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

What would be the output of the following program int a[10]={0,1,2,3,4,5,6,7,8,9}; int *p; p = a; for (int i= 9; i>= 0;

Post by answerhappygod »

What would be the output of the following program
int a[10]={0,1,2,3,4,5,6,7,8,9};
int *p;
p = a;
for (int i= 9; i>= 0; i--)
{
*(p+((i-1)%10)) = i;
printf("%p\n",p);
}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply