Friday, August 19, 2011

Program to swap or interchange two numbers using third variable.

//Program to swap or interchange two numbers using third variable.
#include<stdio.h>
#include<conio.h>
main()
{
 int a,b,c;
 clrscr();
 printf(" enter the value of a and b:");
 scanf("%d%d",&a,&b);
 printf("\n values of a and b before swapping");
 printf("\n a=%d b=%d",a,b);
 c=a;
 a=b;
 b=c;
 printf("\n values of a and b after swapping");
 printf("\n a=%d b=%d",a,b);
 getch();
}

Previous Next Home
0 Comments
Comments

Leave a Comment

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Twitter Delicious Facebook Favorites More