Geekpedia Tutorials Home

Building a C# Chat Client and Server

Building a C# Chat Client and ServerA step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.

in C# Programming Tutorials

Getting Hard Drive Information

Getting Hard Drive InformationA C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.

in C# Programming Tutorials

UPS Shipping Calculator

UPS Shipping CalculatorThis tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.

in PHP Programming Tutorials

Create Your Own Rich Text Editor

Create Your Own Rich Text EditorCreating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.

in JavaScript Programming Tutorials
Search
Tutorials
Programming Tutorials
IT Jobs
From CareerBuilder

How to swap two numbers without using a third variable

On Sunday, October 7th 2007 at 03:04 PM
By Andrew Pociu (View Profile)
*****   (Rated 4.4 with 19 votes)
Advertisement
More C++ Resources

Using pointers you can easily swap two variables without using an additional variable to store a temporary value. This is because instead of swapping values, you can swap addresses, as shown in this function:

void SwapSmart(int * a, int * b)
{
   *a = *a xor *b;
   *b = *b xor *a;
   *a = *a xor *b;
}

Digg Digg It!     Del.icio.us Del.icio.us     Reddit Reddit     StumbleUpon StumbleIt     Newsvine Newsvine     Furl Furl     BlinkList BlinkList

Rate Rate this Knowledge Base article
Comment Current Comments
by Ahmed Youssef on Tuesday, October 23rd 2007 at 02:47 AM

You may do something like this

void swap(int *a, int *b){
*a=*a+*b;
*b=*a-*b;

*a=*a-*b;
}

by sujith kumar on Monday, December 10th 2007 at 06:41 AM

Really Good

by Matt Lewis on Wednesday, January 16th 2008 at 09:35 PM

That would be what is known as the infamous Butterfly Switch.

by Dee on Friday, February 1st 2008 at 09:20 AM

ISO-C++ provides a swap function, so you don\'t need to write one yourself at all.

by A. Chakradhar Patro on Monday, February 4th 2008 at 01:36 AM

It is possible two swap 2 numbers without using arithmetic and bitwise operators?
If so how. Pl. send the code.

by A. Chakradhar Patro on Monday, February 4th 2008 at 01:39 AM

It is possible two swap 2 numbers without using arithmetic and bitwise operators?
If so how. Pl. send the code.

by Anand on Friday, February 15th 2008 at 05:58 AM

query..
how to swap to 2 numbers in one single text box using php program

by ruchita on Saturday, March 1st 2008 at 11:02 AM

its very simple


a=a+b;
b=a=b;
a=a-b

by ruchita on Saturday, March 1st 2008 at 11:03 AM

its very simple

a=a+b;
b=a-b;
a=a-b;

by vidya on Wednesday, March 5th 2008 at 04:56 AM

a = a ^ b
b= a ^ b
a = a^ b

by karan on Sunday, April 27th 2008 at 05:12 AM

thanks ruchita................!

by Fadi Awan on Monday, November 10th 2008 at 12:11 PM

Guys u're fantastic..........

by Fadi Awan on Monday, November 10th 2008 at 12:11 PM

Guys u're fantastic..........

by Joe on Thursday, November 20th 2008 at 06:38 AM

Thanks dude! u r fantastic

by abhishek on Friday, December 12th 2008 at 03:08 AM

you all are dangerous

by Jeyaprakash on Saturday, January 10th 2009 at 06:53 AM

Is this program suitable for values a=65534 and b=65533

by Viswa on Thursday, March 12th 2009 at 04:03 AM

Thank u

by 3mie on Thursday, March 12th 2009 at 02:23 PM


How about for character???

by Chiz on Tuesday, March 24th 2009 at 06:24 AM

How it will be looks like in C#?

by Purna Magum on Tuesday, April 7th 2009 at 05:25 AM

a=a*b;
b=a/b;
a=a/b;

by kshama porwal on Tuesday, September 8th 2009 at 02:15 PM

hi purna ,ur answer is not giving right value when the value of variable is 0.

by subhash on Sunday, September 20th 2009 at 12:04 PM

thik u........sol my problem.

by srikanth on Thursday, October 8th 2009 at 02:44 AM

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleFunSwap
{
class Program
{
static void swap(int x,int y)
{
int c;
c = x;
x = y;
y = c;
}


static void Main(string[] args)
{
int a, b;
a = 300;
b = 200;
swap(a, b);
System.Console.WriteLine("{0}{1}", a, b);
System.Console.ReadLine();
}
}
}
"Here in values of a,b are swapped in function,
but when it come's to main again it's retaining its original values and i want the swapped values to be printed on console". if any one can help me out please.

by mani on Thursday, November 12th 2009 at 09:20 AM

how to swap two numbers using arithmetic operator.i want whole program.

by Syed Abbas Shamim Rizvi on Friday, January 8th 2010 at 11:32 PM

A=10
B=5

A=A B;
A=10 5
A=15

B=A-B;
B=15-5
B=10;

A=A-b;
A=15-10;
A=5

A=A B;
B=A-B;
A=A-B;

by Urmi on Monday, January 18th 2010 at 12:56 AM

Hey! Can anyone tell me how one would swap strings in C/C without using a third variable and using pointers? i tried using memcpy() the results were not very satisfying.

by Toby Lortz on Thursday, February 4th 2010 at 04:42 PM

@srikanth
This should work, you need to use "ref".

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleFunSwap
{
class Program
{
static void swap(ref int x, ref int y)
{
int c;
c = x;
x = y;
y = c;
}


static void Main(string[] args)
{
int a, b;
a = 300;
b = 200;
swap(ref a, ref b);
System.Console.WriteLine("{0}{1}", a, b);
System.Console.ReadLine();
}
}
}

by varsha on Wednesday, February 24th 2010 at 01:07 AM

thanx a lot.........

by varsha on Wednesday, February 24th 2010 at 01:07 AM

thanx a lot.........

by jaanu on Saturday, March 6th 2010 at 09:10 PM

Hai .... plz tell me how to write a c program to swap 3 values using "class"..

by jaanu on Saturday, March 6th 2010 at 09:14 PM

How to write a c program using class to swap 3 values ..?

by daisy on Tuesday, March 16th 2010 at 08:57 AM

#include<stdio.h>
#include<conio.h>
void main()
{
int x,y,temp;
clrscr();
void swap(int,int)
printf("enter the two numbers");
scanf("%d%d",

by jaanu on Wednesday, March 17th 2010 at 09:15 AM

thank u ...........

by jaanu on Wednesday, March 17th 2010 at 09:15 AM

thank u ...........

by jaanu on Wednesday, March 17th 2010 at 09:15 AM

thank u ...........

by jaanu on Wednesday, March 17th 2010 at 09:15 AM

thank u ...........

by jaanu on Wednesday, March 17th 2010 at 09:15 AM

thank u ...........

by MUHAMMAD HUSSEIN on Monday, April 26th 2010 at 07:51 PM

I LOVE C PROGRAMMING.
PLS.SEND ME A SOFT COPY THROUGH MY EMAIL.
THANKS.

by MUHAMMAD HUSSEIN on Monday, April 26th 2010 at 07:52 PM

I LOVE C PROGRAMMING.
PLS.SEND ME A SOFT COPY OF C TEXT BOOK THROUGH MY EMAIL.
THANKS.

by MUHAMMAD HUSSEIN on Monday, April 26th 2010 at 07:52 PM

I LOVE C PROGRAMMING.
PLS.SEND ME A SOFT COPY OF C TEXT BOOK THROUGH MY EMAIL.
THANKS.

by daisy on Wednesday, April 28th 2010 at 10:13 AM

thanks that u like c programming..
by the what r u doing roght now???
i mean r u a student or any professional???
plz give ur complete email address and i will try for giving the soft copy to u.......
thanks for commenting..........
with regards daisy

by daisy on Wednesday, April 28th 2010 at 10:13 AM

thanks that u like c programming..
by the what r u doing roght now???
i mean r u a student or any professional???
plz give ur complete email address and i will try for giving the soft copy to u.......
thanks for commenting..........
with regards daisy

by daisy on Wednesday, April 28th 2010 at 10:17 AM

this is another method to swap two numbers without using a variable::
#include<stdio.>
#include<conio.h>
void main()
{
int x,y;
clrscr();
printf("enter any two numbers");
scanf("%d%d",

by shank on Thursday, June 24th 2010 at 05:37 AM

thanks for the info(ruchi)

by Abi on Monday, July 19th 2010 at 10:54 AM

#include<iostream.h> #include<conio.h>
void swap(int

by sandy on Monday, July 19th 2010 at 01:00 PM

can we swap two numbers without use of any third variable and using only bitwise and(

by sandy on Monday, July 19th 2010 at 01:00 PM

can we swap two numbers without use of any third variable and using only bitwise and(

by sandy on Monday, July 19th 2010 at 01:00 PM

can we swap two numbers without use of any third variable and using only bitwise and(

by Abbas on Monday, July 19th 2010 at 05:00 PM

A=1 , B=0

One Way

B=A OR B
A=A AND B

another way

A= A AND B
B= NOT(A)

there might many more

by sandy on Tuesday, July 20th 2010 at 03:02 PM

to abbas

i dont think ur program is write when i take
A=2 B=3

i am not able to swap the numbers using bitwise and and bitwise or operator as said by you in your code

by sandy on Tuesday, July 20th 2010 at 03:02 PM

to abbas

i dont think ur program is write when i take
A=2 B=3

i am not able to swap the numbers using bitwise and and bitwise or operator as said by you in your code

by sandy on Tuesday, July 20th 2010 at 03:06 PM

for both the cases after swaping i am getting result as 3,3 when i have taken A=2,B=3

and for A=1,B=0 i am getting the result after swapping as 0,0

by Abbas on Wednesday, July 21st 2010 at 01:02 AM

oh Sandy Now Check

A=1 , B=0

One Way

B=A OR B
A=A NAND B

another way

A= A AND B
B= NOT(A)

there might many more

by sandy on Friday, July 23rd 2010 at 12:06 PM

to abbas

no this isn't working too please check the code you have posted. next time run it on any compiler and do upload if u get any successful swapping technique...

by sandy on Friday, July 23rd 2010 at 12:06 PM

to abbas

no this isn't working too please check the code you have posted. next time run it on any compiler and do upload if u get any successful swapping technique...

by shank on Friday, July 23rd 2010 at 08:59 PM

Sandy:


Assume two numbers a and b.


the logic here to be used is

a=a b;
b=a-b;
a=a-b;


eg: a=5,b=6
a=5 6 ie.a=11
b=11-6 ie.b=5
a=11-5 ie a=6


a=6 and b=5 thus they are swapped ma... take care all the best

by Abbas on Saturday, July 24th 2010 at 04:20 AM

Sandy
Dear that Swaping for BIT using AND Operator

by Ashwani sharma on Monday, July 26th 2010 at 03:37 AM

Please send me shorting programs in c
I have to need it.

by Sandy on Wednesday, July 28th 2010 at 09:11 AM

Hey shank

I am asking a pgm for swapping of two variables with out using third variable and also using bitwise and/or operators only. Not, using any other arithmetic operators

by mee on Friday, July 30th 2010 at 03:35 PM

dats really very useful.. thanks a lot..

by mee on Friday, July 30th 2010 at 03:35 PM

dats really very useful.. thanks a lot..

by mee on Friday, July 30th 2010 at 03:35 PM

dats really very useful.. thanks a lot..

by mee on Friday, July 30th 2010 at 03:35 PM

dats really very useful.. thanks a lot..

by Abi on Friday, July 30th 2010 at 04:22 PM

//Swapping of 2 variables without using 3rd variable

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter a = ");
scanf("%d",

by prasanna on Monday, August 2nd 2010 at 06:41 AM

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("enter two numbers");
scanf("%d%d",

by lingaraj on Monday, August 2nd 2010 at 06:45 AM

prasanna ur program is very superb thanks for sent mail,do u hav any other pgm pls mail me

by shank on Monday, August 2nd 2010 at 01:00 PM

sandy,


i'll send it by tomo

by shank on Monday, August 2nd 2010 at 01:00 PM

sandy,


i'll send it by tomo

by shank on Monday, August 2nd 2010 at 01:00 PM

sandy,


i'll send it by tomo

by shank on Monday, August 2nd 2010 at 01:00 PM

sandy,


i'll send it by tomo

by shank on Monday, August 2nd 2010 at 01:00 PM

sandy,


i'll send it by tomo

by shank on Monday, August 2nd 2010 at 01:00 PM

sandy,


i'll send it by tomo

by shank on Monday, August 2nd 2010 at 01:00 PM

sandy,


i'll send it by tomo

by shank on Monday, August 2nd 2010 at 01:00 PM

sandy,


i'll send it by tomo

by shank on Monday, August 2nd 2010 at 01:00 PM

sandy,


i'll send it by tomo

by shank on Monday, August 2nd 2010 at 01:00 PM

sandy,


i'll send it by tomo

by shank on Monday, August 2nd 2010 at 01:00 PM

sandy,


i'll send it by tomo

by shank on Monday, August 2nd 2010 at 01:00 PM

sandy,


i'll send it by tomo

by MIkE on Monday, August 16th 2010 at 07:23 PM

A =B; B=A-B; A=B-A
is not working for high values, because they will go out of range!

A*=B; B=A/B; A=A/B
same problem as above and also is not working if one of the values is 0

A^=B; B^=A; A^=B (^= meaning xor ;)
can't see any problems with this!

you can get xor with and,or and not
e.g.: A xor B = (A not and B) and (A or B)

but normally the system already gives you xor, when you got and/or/not :)

by vikram on Tuesday, August 24th 2010 at 03:08 AM

a=((a b)-(b=(a-b) b))

by vikram on Tuesday, August 24th 2010 at 03:08 AM

a=((a b)-(b=(a-b) b))

by Kisa on Friday, October 15th 2010 at 02:12 AM

Can someone please help me with this:

1. GIVEN THE VALUES X, Y, Z. WRITES A RPOGRAM TO ROTATE THEIR VALUES SUCH THAT X HAS THE VALUE OF Y, Y HAS THE VALUE OF Z AND Z HAS THE VALUE OF X.
2. FOR A CERTAIN ELECTRICAL CIRCUIT WITH AN INDISTANCE L AND RESISTANCE K. THE DUMPED NATURAL FREQUENCY IS GIVEN BY;
FREQUENCY=SQUARE ROOT OF 1/LC –R^2/4C^2(i.e. r squared and 4c squared)
IT IS DESIRED TO STUDY THE VARIATION OF THE FREQUENCY WITH C (CAPASISTANCE). WRITE A PROGRAM TO CALCULATE THE FREQUENCY FOR DIFFERENT VALUES OF C STARTING FROM 0.01 TO 0.1 IN STEPS OF 0.01.
3. WRITE A PROGRAM TO DETERMINE WHETHER A GIVEN INTEGER IS ODD OR EVEN AND DISPLAYS THE NUMBER AND DESCRIPTION ON THE SAME LINE.
4. THE TOTAL DISTANCE TRAVELLED BY A VEHICLE IN t seconds IS GIVEN BY ;
DISTANCE= ut (at^2)/2 (i.e. at squared)
WHERE u IS THE INITIAL VELOCITY I.E.IN M/S AND a IS THE ACCELERATION IN M/S^2(METRES PER SECOND SQUARED). WRITE A PROGRAM TO EVALUATE THE DISTANCE TRAVELLED AT REGULAR INTERVALS OF TIME, GIVEN THE VALUES OF u and a.
THE PROGRAM SHOULD PROVIDE THE FLEXIBILITY OF THE USER TO SELECT ITS OWN TIME INTERVALS AND REPEAT THE CALCULATIONS FOR DIFFERENT VALUES OF u AND a.

by Kisa on Friday, October 15th 2010 at 02:12 AM

Can someone please help me with this:

1. GIVEN THE VALUES X, Y, Z. WRITES A RPOGRAM TO ROTATE THEIR VALUES SUCH THAT X HAS THE VALUE OF Y, Y HAS THE VALUE OF Z AND Z HAS THE VALUE OF X.
2. FOR A CERTAIN ELECTRICAL CIRCUIT WITH AN INDISTANCE L AND RESISTANCE K. THE DUMPED NATURAL FREQUENCY IS GIVEN BY;
FREQUENCY=SQUARE ROOT OF 1/LC –R^2/4C^2(i.e. r squared and 4c squared)
IT IS DESIRED TO STUDY THE VARIATION OF THE FREQUENCY WITH C (CAPASISTANCE). WRITE A PROGRAM TO CALCULATE THE FREQUENCY FOR DIFFERENT VALUES OF C STARTING FROM 0.01 TO 0.1 IN STEPS OF 0.01.
3. WRITE A PROGRAM TO DETERMINE WHETHER A GIVEN INTEGER IS ODD OR EVEN AND DISPLAYS THE NUMBER AND DESCRIPTION ON THE SAME LINE.
4. THE TOTAL DISTANCE TRAVELLED BY A VEHICLE IN t seconds IS GIVEN BY ;
DISTANCE= ut (at^2)/2 (i.e. at squared)
WHERE u IS THE INITIAL VELOCITY I.E.IN M/S AND a IS THE ACCELERATION IN M/S^2(METRES PER SECOND SQUARED). WRITE A PROGRAM TO EVALUATE THE DISTANCE TRAVELLED AT REGULAR INTERVALS OF TIME, GIVEN THE VALUES OF u and a.
THE PROGRAM SHOULD PROVIDE THE FLEXIBILITY OF THE USER TO SELECT ITS OWN TIME INTERVALS AND REPEAT THE CALCULATIONS FOR DIFFERENT VALUES OF u AND a.

by Deric on Wednesday, December 1st 2010 at 12:51 AM

Pls i need help on the question that is about given the values of the variables x y z...

by sam on Wednesday, January 5th 2011 at 12:59 AM

waoooo gr8 logics....
fantastic

by sam on Wednesday, January 5th 2011 at 12:59 AM

waoooo gr8 logics....
fantastic

by shalini on Saturday, January 8th 2011 at 02:06 AM

please give the soft copy in c program

by Saad on Saturday, January 15th 2011 at 05:49 PM

http://bitsbyta.blogspot.com/2011/01/swapping-values-without-third-variable.html

The following code shows you how two swap between two values without being introduced the third variable.








int a;
int b;

cout<<" Enter A : ";
cin>>a;

cout<<" Enter B : ";
cin>>b;

a = a b;
b = a - b;
a = a - b;

cout<<" After Swapping A is : "<<a;
cout<<" After Swapping B is : "<<b;


Output of Program:

Enter A : 12
Enter B : 21

After Swapping A is : 21
After Swapping B is : 12

by Donny on Thursday, February 3rd 2011 at 12:15 PM

a ^= b ^= a ^= b;

by esperanza on Wednesday, February 9th 2011 at 08:41 AM

thanks a lot for ur help!!! :)

by esperanza on Wednesday, February 9th 2011 at 08:41 AM

thanks a lot for ur help!!! :)

by Irfan patel on Sunday, February 13th 2011 at 09:50 AM

we can do ths in 1 line too
a=b a-(b=a);

by irfan patel on Sunday, February 13th 2011 at 09:54 AM

oops! i mistyped in above comment
a=b a-(b=a);
in fact it is very easy 2 remenber,
start reading 4rm right
1)put a into b
2)subtract a and b(which is equal to a now)
3)put b into a

by Donny on Sunday, February 13th 2011 at 03:00 PM

I think I'll state that what I wrote is probably the easiest way to do it. Don't try to do arithmetic to the variables. If your numbers are too big, you'll be trying to put a value larger than it can handle.

So use:
a ^= b ^= a ^= b;
No extra variables required, and its compact. Its also not going to fail at some point.

by renjith on Saturday, February 19th 2011 at 10:23 AM

Plz Help on this:
1.Write a program in c to swap first half with second half of one dimensional array?

2.Write a program to shift negative odd elements to left and negative even elements to right??

3.Write aprogram to delete al negative elements without using temp variable?

by renjith on Saturday, February 19th 2011 at 11:05 AM

Plz Help on this:
1.Write a program in c to swap first half with second half of one dimensional array?

2.Write a program to shift negative odd elements to left and negative even elements to right??

3.Write aprogram to delete al negative elements without using temp variable?

by govardhan on Monday, March 14th 2011 at 02:22 AM

Write a Dot Net program to swap 2 variable characters without using temp variable.

a=7,b=10

by govardhan on Monday, March 14th 2011 at 02:24 AM

Write a Dot Net program to swap 2 variable characters without using temp variable.

a=7,b=10

by acrlrytes on Friday, March 18th 2011 at 07:29 PM

i think these helped me in my last class test.

by acrlrytes on Friday, March 18th 2011 at 07:29 PM

i think these helped me in my last class test.

by Anu on Monday, June 13th 2011 at 02:03 AM

Thanx a lot

by Akash on Thursday, June 23rd 2011 at 12:12 PM

Can somebody tell me how to write it by using function

by venkat on Friday, July 15th 2011 at 01:58 PM

wat is the program code for swappin two numbers without using temporary variable and without using expression

by venkat on Friday, July 15th 2011 at 01:58 PM

wat is the program code for swappin two numbers without using temporary variable and without using expression

by venkat on Friday, July 15th 2011 at 01:58 PM

wat is the program code for swappin two numbers without using temporary variable and without using expression

by venkat on Friday, July 15th 2011 at 01:58 PM

wat is the program code for swappin two numbers without using temporary variable and without using expression

by venkat on Friday, July 15th 2011 at 01:58 PM

wat is the program code for swappin two numbers without using temporary variable and without using expression

by venkat on Friday, July 15th 2011 at 01:58 PM

wat is the program code for swappin two numbers without using temporary variable and without using expression

by venkat on Friday, July 15th 2011 at 01:59 PM

what is the program code for swapping two numbers without using temporary variable and without using expression

by venkat on Friday, July 15th 2011 at 01:59 PM

what is the program code for swapping two numbers without using temporary variable and without using expression

by venkat on Friday, July 15th 2011 at 01:59 PM

what is the program code for swapping two numbers without using temporary variable and without using expression

by venkat on Friday, July 15th 2011 at 01:59 PM

what is the program code for swapping two numbers without using temporary variable and without using expression

by venkat on Friday, July 15th 2011 at 01:59 PM

what is the program code for swapping two numbers without using temporary variable and without using expression

by venkat on Friday, July 15th 2011 at 01:59 PM

what is the program code for swapping two numbers without using temporary variable and without using expression

by venkat on Friday, July 15th 2011 at 01:59 PM

what is the program code for swapping two numbers without using temporary variable and without using expression

by saravanan on Friday, August 5th 2011 at 01:25 PM

it is nice one its very useful for me. will expecting more information form u...............

by saravanan on Friday, August 5th 2011 at 01:25 PM

it is nice one its very useful for me. will expecting more information form u...............

by beverly on Tuesday, August 9th 2011 at 02:53 AM

how i can solve my problem regarding with the following problems.

swapping of numbers from highest to lowest.

description:create a program that will ask the user to enter 3 integers. The program will automatically arrange the integers from highest to lowest.

sample output:
hello user welcome to my first project
ENTER 1ST NO:3
ENTER 1ST NO:2
ENTER 1ST NO:5

PROCESS SWAPPING
1ST NO:5
1ST NO:3
1ST NO:2

HOW CAN I SOLVED that problem???

thank you

yours,beverly

by beverly on Tuesday, August 9th 2011 at 02:53 AM

how i can solve my problem regarding with the following problems.

swapping of numbers from highest to lowest.

description:create a program that will ask the user to enter 3 integers. The program will automatically arrange the integers from highest to lowest.

sample output:
hello user welcome to my first project
ENTER 1ST NO:3
ENTER 1ST NO:2
ENTER 1ST NO:5

PROCESS SWAPPING
1ST NO:5
1ST NO:3
1ST NO:2

HOW CAN I SOLVED that problem???

thank you

yours,beverly

by beverly on Tuesday, August 9th 2011 at 02:54 AM

how i can solve my problem regarding with the following problems.

swapping of numbers from highest to lowest.

description:create a program that will ask the user to enter 3 integers. The program will automatically arrange the integers from highest to lowest.

sample output:
hello user welcome to my first project
ENTER 1ST NO:3
ENTER 1ST NO:2
ENTER 1ST NO:5

PROCESS SWAPPING
1ST NO:5
1ST NO:3
1ST NO:2

HOW CAN I SOLVED that problem???

thank you

yours,beverly

by beverly on Tuesday, August 9th 2011 at 02:54 AM

how i can solve my problem regarding with the following problems.

swapping of numbers from highest to lowest.

description:create a program that will ask the user to enter 3 integers. The program will automatically arrange the integers from highest to lowest.

sample output:
hello user welcome to my first project
ENTER 1ST NO:3
ENTER 1ST NO:2
ENTER 1ST NO:5

PROCESS SWAPPING
1ST NO:5
1ST NO:3
1ST NO:2

HOW CAN I SOLVED that problem???

thank you

yours,beverly

by beverly on Tuesday, August 9th 2011 at 02:54 AM

how i can solve my problem regarding with the following problems.

swapping of numbers from highest to lowest.

description:create a program that will ask the user to enter 3 integers. The program will automatically arrange the integers from highest to lowest.

sample output:
hello user welcome to my first project
ENTER 1ST NO:3
ENTER 1ST NO:2
ENTER 1ST NO:5

PROCESS SWAPPING
1ST NO:5
1ST NO:3
1ST NO:2

HOW CAN I SOLVED that problem???

thank you

yours,beverly

by forex blog on Saturday, November 5th 2011 at 03:29 AM

What I wouldnt give to have a debate with you about this.

by best balance transfer credit cards on Saturday, December 10th 2011 at 08:31 AM

I got he thing for getting the The height of the content area of a browser(ie viewport), but how do i get the height of the entire browser in ie8 including menubar,toolbar etc.For browser's other than ie8 this one works but for ie8 this one do not works. and I introduce your website perfect for my needs. It contains wonderful and helpful posts. I mortal listing most of them and got a lot from them. To me, you are doing the eager set. Fuddle on this. ingest at locating In the end, I would same to give you for making given a very website. Or where I could also gain several of my ranches for marketing substance for you all budy who come up here

by Charles on Saturday, January 28th 2012 at 11:31 PM

Once you have recreated the problem and captured these steps, you can save them to a file and send it to your support person, who can then open it up and view

by Rice Crispy Treats on Sunday, January 29th 2012 at 03:58 PM

I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts.

by casino on Saturday, February 4th 2012 at 06:46 AM

I need to say that you are doing a fantastic job. Please keep up the great work.

by www.ForeclosureHelp.org on Saturday, February 4th 2012 at 08:52 PM

Informative and interesting which we share with you so i think so it is very useful and knowledgeable. I would like to thank you for the efforts. <a href="http://www.grant-applications.org">Grant Applications

by המשיח on Friday, February 10th 2012 at 12:20 PM

I wrote is probably the easiest way to do it. Don't try to do arithmetic to the variables. If your numbers are too big, you'll be trying to put a value larger than it can handle.

by John Doe on Saturday, February 11th 2012 at 05:12 PM

a = ((a b) - (b=a))

by offshore companies uae on Tuesday, February 14th 2012 at 07:53 AM

I have really enjoyed reading your blog posts.

by counter strike 1.6 download on Thursday, February 16th 2012 at 02:31 PM

sharing and posting articles like these.This article has helped me a lot.Keep posting this stuff.

by Offshore Company In UAE on Friday, March 16th 2012 at 05:33 AM

I wish we both can do better in the future.

by manchester signs on Monday, April 23rd 2012 at 07:00 AM

This is because instead of swapping values, you can swap addresses

by Ebony Pussy on Monday, May 21st 2012 at 04:35 PM

I wrote is probably the easiest way to do it.Informative and interesting which we share with you so i think so it is very useful and knowledgeable.I would like to thank you for the efforts.

by Hairy Pussy on Tuesday, May 29th 2012 at 07:00 PM

nice one i like it very much please keep posting thank you .

by Pro Travel Network on Friday, June 15th 2012 at 12:11 PM


Pro Travel Network is the best travel agency in town. They have been dealing in all kind of travel from train travel to cruise travel and air travel !

by Pro Travel Network on Friday, June 15th 2012 at 12:11 PM


Pro Travel Network is the best travel agency in town. They have been dealing in all kind of travel from train travel to cruise travel and air travel !

by Pro Travel Network on Friday, June 15th 2012 at 12:11 PM


Pro Travel Network is the best travel agency in town. They have been dealing in all kind of travel from train travel to cruise travel and air travel !

by beautiful chinese girl on Thursday, July 12th 2012 at 09:51 PM

Useful~Thanks~

by on Tuesday, July 31st 2012 at 12:57 AM

They have been dealing in all kind of travel from train travel to cruise travel and air travel !

by perfect tortilla bowl on Wednesday, August 1st 2012 at 04:34 AM

They have been dealing in all kind of travel from train travel to cruise travel and air travel !

by PURNA MAGUM on Wednesday, August 1st 2012 at 04:44 AM

B=B A-(A=B);

by PURNA MAGUM on Wednesday, August 1st 2012 at 04:44 AM

B=B A-(A=B);

by PURNA MAGUM on Wednesday, August 1st 2012 at 04:44 AM

B=B A-(A=B);

by PURNA MAGUM on Wednesday, August 1st 2012 at 04:44 AM

B=B A-(A=B);

by PURNA MAGUM on Wednesday, August 1st 2012 at 04:44 AM

B=B A-(A=B);

by PURNA MAGUM on Wednesday, August 1st 2012 at 04:44 AM

B=B A-(A=B);

by PURNA MAGUM on Wednesday, August 1st 2012 at 04:45 AM

B=B A-(A=B);

by PURNA MAGUM on Wednesday, August 1st 2012 at 04:45 AM

B=B A-(A=B);

by PURNA MAGUM on Wednesday, August 1st 2012 at 04:45 AM

B=B A-(A=B);

by PURNA MAGUM on Wednesday, August 1st 2012 at 04:45 AM

B=B A-(A=B);

by PURNA MAGUM on Wednesday, August 1st 2012 at 04:45 AM

B=B A-(A=B);

by MIkE on Wednesday, August 1st 2012 at 12:28 PM

How do I unsubscribe from this thread?
:(

by Website Builders World on Thursday, August 2nd 2012 at 01:49 AM

They have been dealing in all kind of travel from train travel to cruise travel and air travel !

by PURNAMAGUM on Thursday, August 2nd 2012 at 01:52 AM

Sorry friends the answer is B = B A - (A = B);

by mimi on Monday, August 6th 2012 at 12:53 AM

Got it!

by that on Monday, August 6th 2012 at 12:57 AM

Unsubscribe

by that on Monday, August 6th 2012 at 12:57 AM

Unsubscribe

by chnlove review on Sunday, September 2nd 2012 at 08:42 PM

Well written article , I appreciate very much

by chn on Sunday, September 2nd 2012 at 08:53 PM

Fantastic question.I would love to see the response of the expert.I am very eager to find the solution of it.

by rajshree on Thursday, December 12th 2013 at 02:16 PM

can anyone say the procedure of drawing a flow chart to swap two numbers..?

by rajshree on Thursday, December 12th 2013 at 02:16 PM

can anyone say the procedure of drawing a flow chart to swap two numbers..?


Comment Comment on this Knowledge Base article
Name: Email:
Message:
Knowledge Base Related Knowledge Base Articles
There are no related KB articles.

Comment Related Source Code
There is no related code.

Comment Related Tutorials
There are no related tutorials.

Jobs C++ Job Search
My skills include:

Enter a City:

Select a State:


Advanced Search >>
Ads

From the creators of Geekpedia, a revolutionary new coupon website!

BargainEZ has coupons codes, printable coupons, bargains and it is the leading source of Passbook coupons for iPhone and iPod touch devices.

Coupons
Discover Geekpedia
Other Resources