C Program to swap to number using temp variable and using pointer:
This is c program to swapping two number using various method. in which we swap variables value to each other.
There are three method by which we can swap value of variable.
1. swapping using temp variable
2. swapping with using of temp variable
3. swapping using pointer variable
ALGORITHM:-

step 1 : Start
step 2 : Enter two integer number
step 3 : Print the variable
step 4 : Swap the value 
step 5 : Print again the swapped value
step 6 : Stop

Swapping Two Numbers Using Temp variable

#include<stdio.h>
#include<conio.h>

void main()
{
    int a,b,temp; 
    printf("Enter any two integers: ");
    scanf("%d%d",&a,&b);
    printf("Before swapping: a = %d, b=%d",a,b);

    temp = a;
    a = b;
    b = temp;
    printf("\nAfter swapping: a = %d, b=%d",a,b);

    getch();
}



Swapping Two Numbers Without Temp variable

#include<stdio.h>
#include<conio.h>

void main()
{
    int a,b;
    printf("Enter any two integers: ");
    scanf("%d%d", &a, &b);
    printf("Before swapping: a = %d, b = %d", a, b);
    a = a + b; 
    b = a - b;
    a = a - b;
    printf("\nAfter swapping: a = %d, b = %d",a, b);
    getch();
}

Swapping of two numbers using pointers

#include<stdio.h>
#include<conio.h>

void main()
{
    int a,b;
    int *ptra,*ptrb;
    int *temp;

    printf("Enter any two integers: ");
    scanf("%d%d",&a,&b);

    printf("Before swapping: a = %d, b=%d",a,b);

    ptra = &a;
    ptrb = &b;

     temp = ptra;
    *ptra = *ptrb;
    *ptrb = *temp;

    printf("\nAfter swapping: a = %d, b=%d",a,b);
    getch();
}

OUTPUT:-

Enter any two integers:
5
6
Befor swapping: a = 5, b = 6

After swapping: a = 6, b = 5

C Program to swap two value using different method
Swapping using pointer in c
Swapping without user third variable
How to swap to value using temp variable