Why this code is showing Segmentation fault (core dumped)?
#include<stdio.h>
void swap(int*,int*);
int main(){
int x=5,y=10;
swap(&x,&y);
printf("%d%d",x,y);
return 1;
}
void swap(int *a,int *b){
int *temp;
*temp = *a;
*a = *b;
*b = *temp;
}