# How to swap the two integers or real numbers without using the third variable in the c language

How to swap the two integers or real numbers without using the third variable in the __c language__. In this whole program, you will learn how to determine the swapping of two integers or real numbers without using the third variable in the __c language__.

Take an example to understand this a __c program__:

```
// How to swap the two integers or real numbers without using the third variable in the c language
#include <stdio.h>
int main() {
double p, q;
printf("----Enter the two integer or real numbers----\n");
scanf("%lf %lf", &p, &q);
p = p - q;
q = p + q;
p = q - p;
printf("After swapping, p = %.2lf\n", p);
printf("After swapping, q = %.2lf\n", q);
return 0;
}
```

**Output:**

----Enter the two integer or real numbers----

10

7

After swapping, p = 7.00

After swapping, q = 10.00

10

7

After swapping, p = 7.00

After swapping, q = 10.00

## Tags:

# how to swapping of two numbers without using the third variable in c language

# make a c program to swap two numbers using the function

# make a c program to swap two numbers without using a third variable using the function