Advertisement
Denis_Hristov

ChangeValues

Mar 15th, 2024
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void changeValues(int* a, int* b, int* temp){
  5.     *temp = *a;
  6.     *a = *b;
  7.     *b = *temp;
  8.  
  9.     printf("Value of a: %d\n", *a);
  10.     printf("Value of b: %d", *b);
  11. }
  12.  
  13.  
  14. int main()
  15. {
  16.     int a = 5;
  17.     int b = 10;
  18.     int temp;
  19.  
  20.     changeValues(&a, &b, &temp);
  21.  
  22.     return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement