Exforsys

Online Training

swapping

This is a discussion on swapping within the C and C++ forums, part of the Programming Talk category; i want to swap two numbers without using third variable...


Go Back   Exforsys > Programming Talk > C and C++

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-09-2008, 01:56 AM
Junior Member
 
Join Date: Feb 2008
Posts: 1
Bhaskar513 is on a distinguished road
swapping

i want to swap two numbers without using third variable
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-13-2008, 04:53 PM
Junior Member
 
Join Date: Mar 2007
Location: coimbatore, india
Posts: 23
lawrence is on a distinguished road
You can do with pointers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-19-2008, 06:10 AM
Junior Member
 
Join Date: Feb 2008
Posts: 1
sathishdpi is on a distinguished road
Quote:
Originally Posted by Bhaskar513 View Post
i want to swap two numbers without using third variable
HI just u try this
A=A+B
B=A-B
A=A-B
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new questions
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Swapping Operation rachelle C and C++ 2 05-01-2007 09:05 AM
Swapping Two Variables without Temp Variable Adrian C and C++ 5 12-05-2006 05:53 AM
Comp.Sys.Acorn.FAQ part 1 of 4 Paul Vigay Tech FAQ 0 05-31-2004 08:00 PM
Comp.Sys.Acorn.FAQ part 1 of 4 Paul Vigay Tech FAQ 0 04-30-2004 08:00 PM


All times are GMT -4. The time now is 05:27 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.