swapping values of two numbers


#include 

void swap(float *n1, float  *n2);

void main()

{

    float first,second;

    printf("Enter the values of M and N \n");

    scanf("%f %f", &first, &second);

    printf("Before :First = %5.2ftSecond = %5.2f\n", first, second);

    swap(&first, &second);

    printf("After Swapping:First  = %5.2ftSecond = %5.2f\n", first, second);

}

/*  Function swap - to interchanges the contents of two items */

void swap(float *n1, float *n2)

{

    float temp;

    temp = *n1;

    *n1 = *n2;

    *n2 = temp;

}