Friday, 18 May 2012

program to Exchange two value use third variable


8./*Write a program to Exchange two value use third variable*/

#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c;
clrscr();
printf("\n ENTER VALUE A:-");
scanf("%d",&a);
printf("\n ENTER VALUE B:-");
scanf("%d",&b);
c=a;
a=b;
b=c;
printf("\n a=%d,b=%d",a,b);
getch();
}
OUTPUT
            ENTER VALUE A:12
            ENTER VALUE B:28
            A=28,B=12

No comments:

Post a Comment