MUstar

IoT C언어 0710 - EX13_1

Jul 15th, 2017
60
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. void input_data(int *pa, int *pb);
  4. void swap_data(void);
  5. void print_data(int a, int b);
  6.  
  7. int a, b;
  8.  
  9. int main(void)
  10. {
  11.     input_data(&a,&b);
  12.     swap_data();
  13.     print_data(a,b);
  14.  
  15.     return 0;
  16. }
  17.  
  18. void input_data(int *pa, int *pb)
  19. {
  20.     printf("두 정수 입력 : ");
  21.     scanf("%d%d", pa,pb);
  22. }
  23.  
  24. void swap_data(void)
  25. {
  26.     int temp;
  27.     temp = b;
  28.     b = a;
  29.     a = temp;
  30. }
  31.  
  32. void print_data(int a, int b)
  33. {
  34.     printf("두 정수 출력 : %d, %d\n",a,b);
  35. }
RAW Paste Data