Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added New Microsoft Word Document.docx
Binary file not shown.
14 changes: 9 additions & 5 deletions swap.c
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
#include <stdio.h>

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;
}
}