Hi Guest
MobileUser
HomePage
Jobs
WalkIn
Articles
Agile
DotNet
WebServices
Mathematics
OOPS
WEB
SharePoint
Java
DataBase
Artificial Intelligence
BigData
Android
XML
Agile
Software
SEO
Science Techonlogy
Repository Questions
PHP
Frameworks
Server
Testing
HR
Java
TPF
Tutorial
Tools
Test and Papers
Silverlight
Science Techonlogy
----- Select Country -----
----- Select Location -----
----- Select Category -----
:) Latest Topic
AJAX
VB.NET
SQL Query
UDDI
CLASS
JavaScript Questions
SharePoint Interview
SilverLight
WCF
general knowledge
ASP.NET
:) Hot Jobs
:) Latest Articles
Follow
Swap two int with temp variable and without temp variable
Question Posted on 01 Sep 2011
Home
>>
DotNet
>>
C#
>>
Swap two int with temp variable and without temp variable
Below source code will help you to swap values between two integer with help of temp variable and without temp variable
//define two variable
int i=2;
int j=6;
//with temp varible
int temp //as a temp varible
//swapping
int temp=i; //swap first variable to temp variable
int i=j; //swap value of second variable to first
j=temp //swap temp to second varible
//without temp varible
i=i+j; //add both number
j=i-j; //subtract second from first
i=i-j; //subtract second from first
0
0
Input Your Comments Or suggestions(If Any)
Name
Email
(optional)
Comments
Other Important Questions
Simplest definition of partial classes and its rules?
Definition of Tuple class with some examples?
Define Race Condition in cSharp?
C#.Net Reserve Words
can we inherit private class level variables in c#
Top Searches:
asp net questions
vb net questions
sql query
uddl questions
class
javascript Questions
sharepoint interview questions and concept
silverlight questions and concept
wcf questions
beans
general knowledge
ajax questions
PHP
|
Biztalk
|
Testing
|
SAP
|
HR
|
Privacy policy |
Terms and Conditions
| Blog
If the copyright of any questions or content or syntax belong to you email us we will remove that(info@crackyourinterview.com or crackyourinterview2018@gmail.com)
Home
About Us
GroupChat
Sitemap
Feedback
Contact us