Bhuvan InfoTech Android App

Download our Android App and browse Technical News, Projects, Computer Tricks more easily with lots of Interesting Features.

Tuesday, June 14, 2016

Swapping two variables without using third variable | C program


#include<stdio.h>

int main()
{
 int a;
 int b;
 printf("Type value of A : ");
 scanf("%i",&a);
 printf("\nType value of b : ");
 scanf("%i",&b);
  a = a + b;
  b = a - b;
  a = a - b ;

 printf("A : %i",a);
 printf("\nB : %i",b);
 return 0;
}
Bhuvan Arora

No comments:

Amazing Deal !