Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void swap(int*x,int*y) {
- int temp=*x;
- *x=*y;
- *y=temp;
- }
- int main() {
- int a,b;
- printf("a= ");
- scanf("%d",&a);
- printf("b= ");
- scanf("%d",&b);
- printf("Before swapping: a=%d,b=%d\n",a,b);
- swap(&a,&b);
- printf("After swapping: a=%d,b=%d\n",a,b);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement