Monday, 10 October 2016

Program to Swap the numbers without using third variable

#include <stdio.h>
#include<conio.h>
void main()
{
        int a,b;
        clrscr();
           printf("Enter the two numbers to swap them\n");
           scanf("%d%d",&a,&b);
       a = a + b;
       b = a - b;
       a = a - b;
  
   printf("\nAfter swapping value of a : %d", a);
   printf("\nAfter swapping value of b : %d", b);
    getch();
}


 Download the Program from 

     Download 

No comments:

Post a Comment