Thursday, 8 September 2016

WAP to exchange value of two variables.


WAP to exchange value of two variables.


//Exchange two variables.

#include<stdio.h>
#include<conio.h>
Void main( )
{
Int a,b,t;
Clrscr( );
Printf(“\n Enter two numbers to be exchanged”);
Scanf(“%d%d”,&a,&b);
T=a;
A=b;
B=t;
Printf(“\n Exchanged numbers are…a=%d\t b=%d”,a,b);
Getch( );
}

Output
Enter two numbers to be exchanged 10 20
Exchanged numbers are….a=20                     b=10



0 comments: