Written by Dinesh Thakur

 

#include<stdio.h>

void main()
{
    int x,y;
    clrscr();
    printf("\nPlease Enter a Number (x):");
    scanf("%d",&x);
    printf("\nPlease Enter a Number (y):");
    scanf("%d",&y);
    printf("\n\nValues Before Swapping\nx=[%d]\ny=[%d]",x,y);
    x=x+y;
    y=x-y;
    x=x-y;
    printf("\n\nValues After Swapping\nx=[%d]\ny=[%d]",x,y);
    getch();

Swap Two Number Without using Third Variable





About Us

Dinesh ThakurDinesh Thakur is a Columinist and designer with strong passion and founder of Computer Notes. if you have any ideas or any request me @
linkedin FaceBook Twitter Google Plus