C Program to Swap Two Numbers

C Program to Swap Two Numbers


#include<stdio.h>
#include<conio.h>
void main()
{
    float a,b,temp;
    printf("Enter a and b\n");
    scanf("%f%f",&a,&b);
    printf("Before swap,a=%f,b=%f\n",a,b);
    temp=a,a=b,b=temp;
    printf("After swap,a=%f,b=%f",a,b);
    getch();
}