Skip to content

Commit bf49d9c

Browse files
committed
changes
1 parent 78fa4a1 commit bf49d9c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

snippets/c/mathematical-functions/swap-numbers.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ tags: swap,numbers
88
```c
99
#include<stdio.h>
1010
void swap(int* num1,int* num2){
11-
*num1= *num1 + *num2;
12-
*num2= *num1 - *num2;
13-
*num1= *num1 - *num2;
11+
*num1 = *num1 + *num2;
12+
*num2 = *num1 - *num2;
13+
*num1 = *num1 - *num2;
1414
}
1515

1616
// Usage:
17-
int a=3,b=4;
18-
auto swapped=swap(&a,&b); // simply use printf after this to print swapped values
17+
int a = 3,b = 4;
18+
swap(&a,&b); // simply use printf after this to print swapped values
1919
```

0 commit comments

Comments
 (0)