Get premium membership and access questions with answers, video lessons as well as revision papers.

What will be the output of the following c program?

      

#include
int *p, x;
int a[5]={100,200,300,400,500};
int *p2;
int main()
{
p=NULL;
x=500;
p=&x;
printf("1) %d %d \n",x,*p,p,&x,&p);
p2=a;
*(p2+1)=*p;
*p= *p2 + *(p2+2);
printf("2) %d %d \n",x,*p,*p2);

return 0;
}

  

Answers


Anthony
1) 500 500
2) 400 400
anmwat answered the question on March 5, 2019 at 10:31


Next: What is the relationship between threads and processes?
Previous: Write a C function that computes that maximum of a specific row R in a 2D array of size 6 by 5.

View More Computer Science Questions and Answers | Return to Questions Index


Learn High School English on YouTube

Related Questions