#include void swap(int *a,int *b){ int p=*b; *b=*a; *a=p; /*int *p=b; b=a; a=p; */ } int main(){ int a,b; scanf(\"%d
In C, all variables declared in a function are local to that specific function. So, you wrote something in function swap
int *p=b;
What above code will do is, it will copy the value of b into p. So, when the function swap return, it's local variables p, b and a will vanished.