C# Corner
Tech
News
Videos
Forums
Trainings
Books
Live
More
Interviews
Events
Jobs
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Swap two variables without using third variable
WhatsApp
Ashish Srivastava
Apr 08
2016
729
0
0
#include<stdio.h>
void
main()
{
int
a=5,b=10;
a=b+a;
b=a-b;
a=a-b;
printf(
"a= %d b= %d"
,a,b);
}
Swap two variables
third variable
Up Next
Swap two variables without using third variable