fork download
  1. #include<stdio.h>
  2. void swap(int*a,int*b);
  3. {int temp;
  4. temp=a
  5. *a=*b
  6. *b=temp
  7. }
  8. int main()
  9. {int num1,int num2;
  10. printf("Enter thr frist number:");
  11. scanf("%d",&num1);
  12. printf("Enter thr second number:");
  13. scanf("%d",&num2);
  14. printf("Before swapping :num1=%d,num2=\n",num1,num2);
  15. swap(&num1,&num2)
  16. printf("After swapping :num1=%d,num2=\n",num1,num2"");
  17. return 0;
  18. }
Success #stdin #stdout 0.02s 25728KB
stdin
Standard input is empty
stdout
#include<stdio.h>
void swap(int*a,int*b);
{int temp;
temp=a
*a=*b
*b=temp
}
int main() 
{int num1,int num2;
printf("Enter thr frist number:");
scanf("%d",&num1);
printf("Enter thr second number:");
scanf("%d",&num2);
printf("Before swapping :num1=%d,num2=\n",num1,num2);
swap(&num1,&num2)
printf("After swapping :num1=%d,num2=\n",num1,num2"");
return 0;
}