C Program to SWAP two Numbers without using temporary Variable

Spread the love

/****************  Program ****************/


#include<stdio.h>

main()
{
int a,b;
printf(“Enter two no’s :”);
scanf(“%d%d”,&a,&b);

printf(“Values Before SWAPPING a : %d.. b: %d..n “,a,b);

a = a + b;
b = a – b;
a = a – b;

printf(“Values After SWAPPING a : %d.. b: %d..n “,a,b);

}

/********** OUTPUT **********/


For Other Method Click Here 

Venkatesh Macha

Hi Guys, I am Venkatesh Macha. I am a programmer and an Open Source enthusiast, Presently working as a Software Engineer. Apart from that, I love to explore new technologies and things.

You may also like...

Leave a Reply