Archive for the ‘CODE’ Category

Program for Exchange of Value of 2 Variable with Temporary Variable

August 29, 2010

//Exchange of value of 2 variable with temp
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,temp;
clrscr();
printf(“\nEnter the value for a & b”);
scanf(“%d%d”,&a,&b);
temp=a;
a=b;
b=temp;
printf(“\na=%d”,a);
printf(“\nb=%d”,b);
getch();
}

Hope you liked my posts, give comments if you have any doubts…:)

(more…)