C Program To Swap Two Numbers

C program to swap two numbers

/* Aim: To swap two numbers */

#include<stdio.h>

int main()
{
	int a,b,t;
 
	printf("\n Enter First Number :");
	scanf("%d",&a);

	printf("\n Enter Second Number :");
	scanf("%d",&b);

	t=a;a=b;
	b=t;

	printf("\n After interchanging the numbers are as follows: \n");
	printf("\n First Number = %d ",a);
	printf("\n \n Second Number = %d \n \n ",t);

	return 0; 
}

/* Output of above code -

 Enter First Number :12

 Enter Second Number :21

 After interchanging the numbers are as follows: 

 First Number = 21 
 
 Second Number = 12 

*/