#include
#include
int main (void)
{
int a[] = {1,2,3,4,5};
int b[] = {0,0,0,0,0};
int *p = b;
for (int i =0; i <
you shouldnt make seperate loop for printing and incrementing the values of the array . do both in same loop and do the follouwing to get ur output :) #include #include
int main(void)
{
int a[]={1,2,3,4,5};
int b[]={0,0,0,0,0};
int c[]={0,0,0,0,0};
int *p;
int i;
p=c;
for( i =0 ; i<5 ; i++)
{
b[i]=a[i]+1;
*p=b[i]-1;
//*p++;
//for( i =0 ; i<5 ; i++)
printf(" %i \t %i \t %i \n" ,*p,b[i],a[i]);
}
return 0;
}