TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Swap two variables without using third variable
Ashish Srivastava
Apr 08
2016
Code
662
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
#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