Search Your C Program

Tuesday, 24 January 2012

Program to exchange the value of two variables

#include<stdio.h>
#include<conio.h>
void main()
{
             int a,b,temp;
             clrscr();
             printf("\n Enter two numbers");
             scanf("%d %d ", &a, &b);
             temp=a;
             a=b;
             b=temp;
             printf("\n exchange numbers are a  = %d    b  =  %d ",a,b);
             getch();
}

No comments:

Post a Comment