C Programming Exercise – Program to Swap 2 Numbers Without Using Temporary, Third Variable
In this C programming language video tutorial / lecture for beginners, you will learn how to swap 2 numbers without using third or temporary variable in detail with example.
Here in this tutorial i have explained this program using c and logic is the same for any other programming language.
Visit http://www.LearningLad.com for more free computer programming video tutorials.
Learn Programming in HINDI at our youtube channel
http://www.youtube.com/user/LearningLadHindi
Catch us on SocialMedia
http://www.facebook.com/LearningLad
http://www.google.com/+LearningLad
Tweets by learningladedu
source by LearningLad
c programming language
Here's an alternative method using xor: a ^= b ^= a ^= b;
which terminal is this?? it is not devcpp which u used in previous videos.
This method works only if 2 number a + b is not overflow.
It's better to use the XOR method.
A ^= B
B ^= A
A ^= B
or combine them A ^= B ^= A ^= B
Here's a better, faster, way:
a=a+b-(b=a)
works with numbers as long as they are the same type, and with characters.
why don't we swap a,b to b,a in the printf statements?
wth is yay it's a
hello, may you please help me write a C program in functions
1. by refrence
2. By value
y ua using Stdlib n thz program… thz nt necessary na????
Geo 🙂
Sir 2135 out 5132 hota h to program kyasay bnayegay
Nice vidio 😘😘😘😘
Thanks bro
Which software is this