diff --git a/New Microsoft Word Document.docx b/New Microsoft Word Document.docx new file mode 100644 index 0000000..d14ddb3 Binary files /dev/null and b/New Microsoft Word Document.docx differ diff --git a/swap.c b/swap.c index d72ac47..89e88d8 100644 --- a/swap.c +++ b/swap.c @@ -1,18 +1,22 @@ #include - +int swap(int *x,int *y) +{ + int temp = *x; + *x = *y; + *y = temp; +} int main() { //hello world + int x, y; printf("Enter Value of x "); scanf("%d", &x); printf("\nEnter Value of y "); scanf("%d", &y); - int temp = x; - x = y; - y = temp; + swap(&x,&y); printf("\nAfter Swapping: x = %d, y = %d", x, y); return 0; -} \ No newline at end of file +}