Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
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 Variable Without using Inbuilt Function and Third Variable
WhatsApp
Vishvajeet Pawar
Nov 15
2014
2
k
0
0
namespace
ConsoleApplication1
{
class
Program
{
static
void
Main(
string
[] args)
{
int
a = 10, b = 20;
Console.WriteLine(
"before Swaping value of a="
+
" "
+ a +
" and b="
+
" "
+ b);
Console.WriteLine();
a = a + b;
b = a - b;
a = a - b;
Console.WriteLine(
"after Swaping value of a="
+
" "
+ a +
" and b="
+
" "
+ b);
Console.ReadLine();
}
}
}
c#
Swap value
Up Next
Swap two Variable Without using Inbuilt Function and Third Variable