//WAP to interchange (swap) two numbers with the help of third variable//
#include<stdio.h>
#include<conio.h>
void main()
{
int a, b, temp;
printf("Enter the values\n");
scanf("%d%d", &a, &b);
printf("Numbers before swapping are:- \na=%d\nb=%d", a, b);
temp=a;
a=b;
b=temp;
printf("Numbers after swapping are:- \na=%d\nb=%d", a, b);
getch();
}


Comments
Post a Comment