Sei sulla pagina 1di 1

WAP to swap the value of two variables using third variable.

#include<stdio.h>
main()
{
int a,b,temp;
printf("Enter the value for a:");
scanf("%d", &a);
printf("Enter the value for b:");
scanf("%d", &b);
temp=a;
a=b;
b=temp;
printf("The swapped values are a=%d and b= %d.\n",a,b);
}

Potrebbero piacerti anche