Sunday, February 8, 2015

Swapping 2 numbers without using the third variable- Learn

#include<iostream.h>
#include<conio.h>
main()
{
            int a,b;
            cout<<”Enter the two numbers.”;
            cin>>a>>b;
            a= a+b;
            b=a-b;
            a=a-b;
            getch();

}

Share

& Comment

0 comments:

Post a Comment

 

Copyright © 2015 Code Fervor™ is a registered trademark.

Designed by Templateism By Naman Kumar