Write a Program to Swap the value of two variables


// This program is to Swap the value of two variables

#include<stdio.h>

main()
{
int a,b,c;
printf("Enter the value of First variable \n");
scanf("%d",&a);
printf("Enter the value of Second variable \n");
scanf("%d",&b);
c=b;
b=a;
a=c;
printf("You Entered the value of a = %d and b = %d \n",b,c);
printf("Swaped value is a = %d and b = %d \n",a,b);
}



/*
INPUT:
Enter the value of First variable
34
Enter the value of Second variable
46
OUTPUT:
You Entered the value of a = 34 and b = 46
Swaped value is a = 46 and b = 34
*/

Comments