We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 78fa4a1 commit bf49d9cCopy full SHA for bf49d9c
snippets/c/mathematical-functions/swap-numbers.md
@@ -8,12 +8,12 @@ tags: swap,numbers
8
```c
9
#include<stdio.h>
10
void swap(int* num1,int* num2){
11
- *num1= *num1 + *num2;
12
- *num2= *num1 - *num2;
13
- *num1= *num1 - *num2;
+ *num1 = *num1 + *num2;
+ *num2 = *num1 - *num2;
+ *num1 = *num1 - *num2;
14
}
15
16
// Usage:
17
-int a=3,b=4;
18
-auto swapped=swap(&a,&b); // simply use printf after this to print swapped values
+int a = 3,b = 4;
+swap(&a,&b); // simply use printf after this to print swapped values
19
```
0 commit comments