PHP
How to Swap Two Number Without Using Third Variable in PHP

How to Swap Two Number Without Using Third Variable in PHP

By: SolutionsHint    32 views Updated: 20th Jan, 2018
How to Swap Two Number Without Using Third Variable in PHP

Hello dear, in this tutorial I will explain How to Swap Two Number Without Using Third Variable in PHP with the help of little logic of the code, swap is nothing its just replace the place vice-versa. so we can swap number by using the third variable to but in this post, we will swap two number without using the third variable.

What Is swapping?

Swapping means just exchanging the value of variable from one place to another place, suppose if you want to swap two no like $a = 20; $b = 30; if you want swap of both variables value (i.e  $a = 30; $b = 20;) this is said to be swapping.

How to Swap Two Number:

output:

 

About the Author

I am a professional blogger from my heart, I am going through all the possible ways that can help to audience. I am trying my best to write content that my readers will like me. I will really be happy when my readers will become more happy with my blog.

Leave a Reply

Your email address will not be published. Required fields are marked *

Tweet
Share
+1
Share
0 Shares