13642 - EECS2310_Lec_5_2   

Description

/* Rewrite this program as stated in the course video */

#include <stdio.h>

void swap(int a, int b){
  int temp;
  temp = a;
  a = b;
  b = temp;
}

int main(void) {
  int x, y;
  scanf("%d %d", &x, &y);

  swap(x,y);
  printf("x=%d, y=%d\n", x, y);
 
  return 0;
}

Input

Output

Sample Input  Download

Sample Output  Download

Tags




Discuss