C program for swapping of two numbers by using third variable

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
puts("Enter the first number");
scanf("%d",&a);
puts("Enter the second number");
scanf("%d",&b);
puts("Before Swapping");
printf("a=%d and b=%d\n",a,b);
c=a;
a=b;
b=c;
puts("After Swapping");
printf("a=%d and b=%d\n",a,b);
}

Comments