Swapping a Number

SWAPPING WITHOUT TEMP:

#include <stdio.h>;
 
void main()
{
int a=20,b=30;
a=a+b;
b=a-b;
a=a-b;
printf("a=%d",a);
printf("b=%d",b);
}

SWAPPIG WITH TEMP:

#include <stdio.h>;
void main()
{
int a=20,b=30,temp;
temp=a;
a=b;
b=temp;
printf("a=%d",a);
printf("b=%d",b);
}

Popularity: 1% [?]

You can leave a response, or trackback from your own site.

Leave a Reply

Designed by: Business Web Hosting | Thanks to Buy Icons, travel tips and Used Cars