Swapping two numbers


Write a C program for swapping of numbers.


 #include<stdio.h>

void main(){
 int a,b,temp;
 printf("Enter two values \n");
 scanf("%d%d",&a,&b);
 printf(" say  \n    a=%d and b=%d \n",a,b);

 temp=a;
 a=b;
 b=temp;
 printf("afetr swapping \n\t");
 printf(" a=%d and b=%d",a,b);
}

Output :

Output