you should not create a separate cycle for printing and increase the values โโof the array. do both in the same loop and do 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; }
Rahul subedi
source share