Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.24 KB | None | 0 0
  1. #include <stdio.h>
  2. void swapnum(int *i, int *j) {
  3.     int temp = *i;
  4.     *i = *j;
  5.     *j = temp;
  6. }
  7.  
  8. int main(void) {
  9.     int a = 10;
  10.     int b = 20;
  11.  
  12.     swapnum(&a, &b);
  13.     printf("A is %d and B is %d\n", a, b);
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement