freelanceprogrammers.org Forum Index » ASP

Re: Write a program to exchange two variaables without anyot


View user's profile Post To page top
travis.falls@... Posted: Wed Jan 18, 2006 7:45 pm


Joined: 10 Jan 2006

Posts: 33
Re: Write a program to exchange two variaables without anyot
your question is a little vague. what are you trying to do... from my past
experience this list works best if you post your code that isn`t working and we
can see it, and try to point you in the correct direction.

Travis D. Falls | Consultant RAFT.Net IT | 860.547.4070 |
travis.falls@...


-----Original Message-----
From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com]On Behalf Of tathira_46
Sent: Wednesday, January 18, 2006 5:01 AM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: [AspNetAnyQuestionIsOk] Write a program to exchange two
variaables without anyother variable----->


Dear friends,
I have one query.

"Write a program to exchange two variables without any other variable?"
Program should be in C or C++

Please if anyone knows then solve and reply me.

Thanks in advance.

good bye









Yahoo! Groups Links









*************************************************************************
This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information. If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited. If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*************************************************************************
Reply with quote
Send private message
View user's profile Post To page top
ghop_98 Posted: Wed Jan 18, 2006 8:02 pm


Joined: 18 Jan 2006

Posts: 3
Re: Write a program to exchange two variaables without anyot
sounds like someone wants the list to do their homework.


----- Original Message -----
From: tathira_46
To: AspNetAnyQuestionIsOk@yahoogroups.com
Sent: Wednesday, January 18, 2006 5:00 AM
Subject: [AspNetAnyQuestionIsOk] Write a program to exchange two variaables
without anyother variable----->


Dear friends,
I have one query.

"Write a program to exchange two variables without any other variable?"
Program should be in C or C++

Please if anyone knows then solve and reply me.

Thanks in advance.

good bye








SPONSORED LINKS Basic programming language Computer programming languages
Programming languages
Java programming language


------------------------------------------------------------------------------
YAHOO! GROUPS LINKS

a.. Visit your group "AspNetAnyQuestionIsOk" on the web.

b.. To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


------------------------------------------------------------------------------



[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
shannonbhall Posted: Wed Jan 18, 2006 8:34 pm


Joined: 18 Jan 2006

Posts: 3
Re: Write a program to exchange two variaables without anyot
exactly

--- dave wanta <dave.wanta@...> wrote:

> sounds like someone wants the list to do their
> homework.
>
>
> ----- Original Message -----
> From: tathira_46
> To: AspNetAnyQuestionIsOk@yahoogroups.com
> Sent: Wednesday, January 18, 2006 5:00 AM
> Subject: [AspNetAnyQuestionIsOk] Write a program
> to exchange two variaables without anyother
> variable----->
>
>
> Dear friends,
> I have one query.
>
> "Write a program to exchange two variables without
> any other variable?"
> Program should be in C or C++
>
> Please if anyone knows then solve and reply me.
>
> Thanks in advance.
>
> good bye
>
>
>
>
>
>
>
>
> SPONSORED LINKS Basic programming language
> Computer programming languages Programming
> languages
> Java programming language
>
>
>
------------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
> a.. Visit your group "AspNetAnyQuestionIsOk" on
> the web.
>
> b.. To unsubscribe from this group, send an
> email to:
>
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
>
> c.. Your use of Yahoo! Groups is subject to the
> Yahoo! Terms of Service.
>
>
>
------------------------------------------------------------------------------
>
>
>
> [Non-text portions of this message have been
> removed]
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Reply with quote
Send private message
View user's profile Post To page top
kindawords Posted: Wed Jan 18, 2006 8:44 pm


Joined: 11 Jan 2006

Posts: 46
Re: Write a program to exchange two variaables without anyot
I smell "interview question".

On 1/18/06, shannon hall <shannonbhall@...> wrote:
> exactly
>
> --- dave wanta <dave.wanta@...> wrote:
>
> > sounds like someone wants the list to do their
> > homework.
> >
> >
> > ----- Original Message -----
> > From: tathira_46
> > To: AspNetAnyQuestionIsOk@yahoogroups.com
> > Sent: Wednesday, January 18, 2006 5:00 AM
> > Subject: [AspNetAnyQuestionIsOk] Write a program
> > to exchange two variaables without anyother
> > variable----->
> >
> >
> > Dear friends,
> > I have one query.
> >
> > "Write a program to exchange two variables without
> > any other variable?"
> > Program should be in C or C++
> >
> > Please if anyone knows then solve and reply me.
> >
> > Thanks in advance.
> >
> > good bye
> >
> >
> >
> >
> >
> >
> >
> >
> > SPONSORED LINKS Basic programming language
> > Computer programming languages Programming
> > languages
> > Java programming language
> >
> >
> >
> ------------------------------------------------------------------------------
> > YAHOO! GROUPS LINKS
> >
> > a.. Visit your group "AspNetAnyQuestionIsOk" on
> > the web.
> >
> > b.. To unsubscribe from this group, send an
> > email to:
> >
> > AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> >
> > c.. Your use of Yahoo! Groups is subject to the
> > Yahoo! Terms of Service.
> >
> >
> >
> ------------------------------------------------------------------------------
> >
> >
> >
> > [Non-text portions of this message have been
> > removed]
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>


--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
Reply with quote
Send private message
View user's profile Post To page top
raviss_03 Posted: Wed Jan 18, 2006 9:11 pm


Joined: 14 Jan 2006

Posts: 4
Re: Write a program to exchange two variaables without anyot
I am trying to read a CSV file which has "28:30:00" as
one of its values in a field called "length".

When I try to do a dataread of this value I always end
up getting "1/1/1900 12:00:00". Convert.ToString
doesn`t help either.
My code is given below.

I would appreciate any suggestions.

Thanks

Ravi

While dr.Read()
If Not dr.Item(4) Is DBNull.Value Then
col5 = Convert.ToString(dr(4))
End if
End While

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Reply with quote
Send private message
View user's profile Post To page top
love_sms143 Posted: Wed Jan 18, 2006 9:12 pm


Joined: 18 Jan 2006

Posts: 1
Re: Write a program to exchange two variaables without anyot
Hi,

just use 2 var like a & b


a= 12
b= 4

a = a-b
a=12-4 =8
a= 8

b = a + b
b = 8 + 4 =12

a = b- a
a = 12 - 8 = 4
a = 4

a = 4 & b = 12


dave wanta <dave.wanta@...> wrote:
sounds like someone wants the list to do their homework.


----- Original Message -----
From: tathira_46
To: AspNetAnyQuestionIsOk@yahoogroups.com
Sent: Wednesday, January 18, 2006 5:00 AM
Subject: [AspNetAnyQuestionIsOk] Write a program to exchange two variaables
without anyother variable----->


Dear friends,
I have one query.

"Write a program to exchange two variables without any other variable?"
Program should be in C or C++

Please if anyone knows then solve and reply me.

Thanks in advance.

good bye








SPONSORED LINKS Basic programming language Computer programming languages
Programming languages
Java programming language


------------------------------------------------------------------------------
YAHOO! GROUPS LINKS

a.. Visit your group "AspNetAnyQuestionIsOk" on the web.

b.. To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


------------------------------------------------------------------------------



[Non-text portions of this message have been removed]



SPONSORED LINKS
Basic programming language Computer programming languages
Programming languages Java programming language

---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------






Thanx

Sam Hansh
Impossible itself consists "I M POSSIBLE".


---------------------------------
Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays,
whatever.

[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
vvskm Posted: Wed Jan 18, 2006 9:39 pm


Joined: 19 Jan 2006

Posts: 3
Re: Write a program to exchange two variaables without anyot
int a =10; int b = 20;

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

Result
a = 20; b=10;

- Krishna Vemuri



Dean Fiala <dfiala@...> wrote: I smell "interview question".

On 1/18/06, shannon hall <shannonbhall@...> wrote:
> exactly
>
> --- dave wanta <dave.wanta@...> wrote:
>
> > sounds like someone wants the list to do their
> > homework.
> >
> >
> > ----- Original Message -----
> > From: tathira_46
> > To: AspNetAnyQuestionIsOk@yahoogroups.com
> > Sent: Wednesday, January 18, 2006 5:00 AM
> > Subject: [AspNetAnyQuestionIsOk] Write a program
> > to exchange two variaables without anyother
> > variable----->
> >
> >
> > Dear friends,
> > I have one query.
> >
> > "Write a program to exchange two variables without
> > any other variable?"
> > Program should be in C or C++
> >
> > Please if anyone knows then solve and reply me.
> >
> > Thanks in advance.
> >
> > good bye
> >
> >
> >
> >
> >
> >
> >
> >
> > SPONSORED LINKS Basic programming language
> > Computer programming languages Programming
> > languages
> > Java programming language
> >
> >
> >
>
------------------------------------------------------------------------------
> > YAHOO! GROUPS LINKS
> >
> > a.. Visit your group "AspNetAnyQuestionIsOk" on
> > the web.
> >
> > b.. To unsubscribe from this group, send an
> > email to:
> >
> > AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> >
> > c.. Your use of Yahoo! Groups is subject to the
> > Yahoo! Terms of Service.
> >
> >
> >
>
------------------------------------------------------------------------------
> >
> >
> >
> > [Non-text portions of this message have been
> > removed]
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>


--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com


SPONSORED LINKS
Basic programming
language Computer programming languages
Programming languages
Java programming language

---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------






---------------------------------
Yahoo! Photos – Showcase holiday pictures in hardcover
Photo Books. You design it and we’ll bind it!

[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
vvskm Posted: Wed Jan 18, 2006 10:06 pm


Joined: 19 Jan 2006

Posts: 3
Re: Write a program to exchange two variaables without anyot
int a =10; int b = 20;

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

Result
a = 20; b=10;

- Krishna Vemuri


--- In AspNetAnyQuestionIsOk@yahoogroups.com, Dean Fiala <dfiala@g...>
wrote:
>
> I smell "interview question".
>
> On 1/18/06, shannon hall <shannonbhall@y...> wrote:
> > exactly
> >
> > --- dave wanta <dave.wanta@1...> wrote:
> >
> > > sounds like someone wants the list to do their
> > > homework.
> > >
> > >
> > > ----- Original Message -----
> > > From: tathira_46
> > > To: AspNetAnyQuestionIsOk@yahoogroups.com
> > > Sent: Wednesday, January 18, 2006 5:00 AM
> > > Subject: [AspNetAnyQuestionIsOk] Write a program
> > > to exchange two variaables without anyother
> > > variable----->
> > >
> > >
> > > Dear friends,
> > > I have one query.
> > >
> > > "Write a program to exchange two variables without
> > > any other variable?"
> > > Program should be in C or C++
> > >
> > > Please if anyone knows then solve and reply me.
> > >
> > > Thanks in advance.
> > >
> > > good bye
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > SPONSORED LINKS Basic programming language
> > > Computer programming languages Programming
> > > languages
> > > Java programming language
> > >
> > >
> > >
> >
------------------------------------------------------------------------------
> > > YAHOO! GROUPS LINKS
> > >
> > > a.. Visit your group "AspNetAnyQuestionIsOk" on
> > > the web.
> > >
> > > b.. To unsubscribe from this group, send an
> > > email to:
> > >
> > > AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> > >
> > > c.. Your use of Yahoo! Groups is subject to the
> > > Yahoo! Terms of Service.
> > >
> > >
> > >
> >
------------------------------------------------------------------------------
> > >
> > >
> > >
> > > [Non-text portions of this message have been
> > > removed]
> > >
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> --
> Dean Fiala
> Very Practical Software, Inc
> http://www.vpsw.com
>
Reply with quote
Send private message
View user's profile Post To page top
ahmadrd1_2000 Posted: Wed Jan 18, 2006 10:21 pm


Joined: 18 Jan 2006

Posts: 1
Re: Write a program to exchange two variaables without anyot
that`s right
you are good in calculation
i spend 20 min but can`t find it


On 1/18/06, vvskm <vvskm@...> wrote:
> int a =10; int b = 20;
>
> a = a+b;
> b = a-b;
> a = a-b;
>
> Result
> a = 20; b=10;
>
> - Krishna Vemuri
>
>
> --- In AspNetAnyQuestionIsOk@yahoogroups.com, Dean Fiala <dfiala@g...>
> wrote:
> >
> > I smell "interview question".
> >
> > On 1/18/06, shannon hall <shannonbhall@y...> wrote:
> > > exactly
> > >
> > > --- dave wanta <dave.wanta@1...> wrote:
> > >
> > > > sounds like someone wants the list to do their
> > > > homework.
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: tathira_46
> > > > To: AspNetAnyQuestionIsOk@yahoogroups.com
> > > > Sent: Wednesday, January 18, 2006 5:00 AM
> > > > Subject: [AspNetAnyQuestionIsOk] Write a program
> > > > to exchange two variaables without anyother
> > > > variable----->
> > > >
> > > >
> > > > Dear friends,
> > > > I have one query.
> > > >
> > > > "Write a program to exchange two variables without
> > > > any other variable?"
> > > > Program should be in C or C++
> > > >
> > > > Please if anyone knows then solve and reply me.
> > > >
> > > > Thanks in advance.
> > > >
> > > > good bye
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > SPONSORED LINKS Basic programming language
> > > > Computer programming languages Programming
> > > > languages
> > > > Java programming language
> > > >
> > > >
> > > >
> > >
> ------------------------------------------------------------------------------
> > > > YAHOO! GROUPS LINKS
> > > >
> > > > a.. Visit your group "AspNetAnyQuestionIsOk" on
> > > > the web.
> > > >
> > > > b.. To unsubscribe from this group, send an
> > > > email to:
> > > >
> > > > AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> > > >
> > > > c.. Your use of Yahoo! Groups is subject to the
> > > > Yahoo! Terms of Service.
> > > >
> > > >
> > > >
> > >
> ------------------------------------------------------------------------------
> > > >
> > > >
> > > >
> > > > [Non-text portions of this message have been
> > > > removed]
> > > >
> > > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam? Yahoo! Mail has the best spam protection around
> > > http://mail.yahoo.com
> > >
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> > --
> > Dean Fiala
> > Very Practical Software, Inc
> > http://www.vpsw.com
> >
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>


--
Ahmad Fahel
Palestine
Reply with quote
Send private message
View user's profile Post To page top
dmartin@... Posted: Wed Jan 18, 2006 11:08 pm


Joined: 12 Jan 2006

Posts: 5
Re: Write a program to exchange two variaables without anyot
.Net is thinking for you. It is trying to convert what it thinks is a time value
into a datetime datatype.

If you are not dealinng with datetime datatypes, then perform a replace on the
colons in the string. Perhaps replace the colons with dashes, spaces, or dots.

col5 = Replace(dr(4),":",".")








Quoting Ravi Swaminathan <raviss_03@...>:

> I am trying to read a CSV file which has "28:30:00" as
> one of its values in a field called "length".
>
> When I try to do a dataread of this value I always end
> up getting "1/1/1900 12:00:00". Convert.ToString
> doesn`t help either.
> My code is given below.
>
> I would appreciate any suggestions.
>
> Thanks
>
> Ravi
>
> While dr.Read()
> If Not dr.Item(4) Is DBNull.Value Then
> col5 = Convert.ToString(dr(4))
> End if
> End While
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
Reply with quote
Send private message
View user's profile Post To page top
peter_brunone Posted: Wed Jan 18, 2006 11:13 pm


Joined: 11 Jan 2006

Posts: 38
Re: Write a program to exchange two variaables without anyot
What is your code for putting the csv into the datareader?

On 1/18/06, Ravi Swaminathan <raviss_03@...> wrote:
>
> I am trying to read a CSV file which has "28:30:00" as
> one of its values in a field called "length".
>
> When I try to do a dataread of this value I always end
> up getting "1/1/1900 12:00:00". Convert.ToString
> doesn`t help either.
> My code is given below.
>
> I would appreciate any suggestions.
>
> Thanks
>
> Ravi
>
> While dr.Read()
> If Not dr.Item(4) Is DBNull.Value Then
> col5 = Convert.ToString(dr(4))
> End if
> End While


[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
vvskm Posted: Thu Jan 19, 2006 12:13 am


Joined: 19 Jan 2006

Posts: 3
Re: Write a program to exchange two variaables without anyot
I think, by default, the CSV is thinking the value "28:30:00" of type `Time`.
If you can change the Cell Format of CSV into "Text" then you can let the .NET
to retrive the value.

- Krishna Vemuri.

Peter Brunone <peter.brunone@...> wrote: What is your code for
putting the csv into the datareader?

On 1/18/06, Ravi Swaminathan <raviss_03@...> wrote:
>
> I am trying to read a CSV file which has "28:30:00" as
> one of its values in a field called "length".
>
> When I try to do a dataread of this value I always end
> up getting "1/1/1900 12:00:00". Convert.ToString
> doesn`t help either.
> My code is given below.
>
> I would appreciate any suggestions.
>
> Thanks
>
> Ravi
>
> While dr.Read()
> If Not dr.Item(4) Is DBNull.Value Then
> col5 = Convert.ToString(dr(4))
> End if
> End While


[Non-text portions of this message have been removed]



---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------






---------------------------------
Yahoo! Photos – Showcase holiday pictures in hardcover
Photo Books. You design it and we’ll bind it!

[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
raviss_03 Posted: Thu Jan 19, 2006 5:37 am


Joined: 14 Jan 2006

Posts: 4
Re: Write a program to exchange two variaables without anyot
Thanks for your suggestions.

I could use the OdbcDataReader to do the data reads.
However, for my specific needs, where I need to update
a few columns in the file (without the need to create
database tables), I convert it to DBF using:

x0 = CreateObject("excel.application")
wa =
x0.Workbooks.Open("C:TestFiles est.csv")
x0.Visible = False

x0.ActiveWorkbook.SaveAs(filename:="C:TestFiles est.dbf",
FileFormat:=Excel.XlFileFormat.xlDBF3)
x0.ActiveWorkBook.Close(False)

Then open the DBF file:

myConnection= New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source = ""C:Testfiles"";Extended Properties=dBASE
III")
concsv.Open()

myDBFCommand = New OleDbCommand("Select * from " &
strDBF, concsv)
dr = myDBFCommand.ExecuteReader()



Thanks

Ravi
--- Krishna Vemuri <vvskm@...> wrote:

> I think, by default, the CSV is thinking the value
> "28:30:00" of type `Time`. If you can change the
> Cell Format of CSV into "Text" then you can let the
> .NET to retrive the value.
>
> - Krishna Vemuri.
>
> Peter Brunone <peter.brunone@...> wrote:
> What is your code for putting the csv into the
> datareader?
>
> On 1/18/06, Ravi Swaminathan <raviss_03@...>
> wrote:
> >
> > I am trying to read a CSV file which has
> "28:30:00" as
> > one of its values in a field called "length".
> >
> > When I try to do a dataread of this value I
> always end
> > up getting "1/1/1900 12:00:00". Convert.ToString
> > doesn`t help either.
> > My code is given below.
> >
> > I would appreciate any suggestions.
> >
> > Thanks
> >
> > Ravi
> >
> > While dr.Read()
> > If Not dr.Item(4) Is DBNull.Value Then
> > col5 = Convert.ToString(dr(4))
> > End if
> > End While
>
>
> [Non-text portions of this message have been
> removed]
>
>
>
> ---------------------------------
> YAHOO! GROUPS LINKS
>
>
> Visit your group "AspNetAnyQuestionIsOk" on the
> web.
>
> To unsubscribe from this group, send an email
> to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to the
> Yahoo! Terms of Service.
>
>
> ---------------------------------
>
>
>
>
>
>
> ---------------------------------
> Yahoo! Photos – Showcase holiday pictures in
> hardcover
> Photo Books. You design it and we’ll bind it!
>
> [Non-text portions of this message have been
> removed]
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Reply with quote
Send private message
View user's profile Post To page top
anuj_kr_mca Posted: Fri Jan 20, 2006 10:47 am


Joined: 20 Jan 2006

Posts: 1
Re: Write a program to exchange two variaables without anyot
But this tecnique has a major bug, let us suppose both a & b are of Int type,
then following code will give wrong result
a = 65535
b = 65534
then a = a + b will exceed the maximum upper bound of the value an int ( 2
byte) can hold..

so this method should not use for swaping, it can save memory because it does
not need a third variable, but it may give wrong result in many conditions,
which is more harm full.

Thanx

Anuj Kumar
+91 9313499294
S/W engg.
Nagarro Soft. Pvt. Ltd., Gurgaon


Sam Hansh <love_sms143@...> wrote:
Hi,

just use 2 var like a & b


a= 12
b= 4

a = a-b
a=12-4 =8
a= 8

b = a + b
b = 8 + 4 =12

a = b- a
a = 12 - 8 = 4
a = 4

a = 4 & b = 12


dave wanta <dave.wanta@...> wrote:
sounds like someone wants the list to do their homework.


----- Original Message -----
From: tathira_46
To: AspNetAnyQuestionIsOk@yahoogroups.com
Sent: Wednesday, January 18, 2006 5:00 AM
Subject: [AspNetAnyQuestionIsOk] Write a program to exchange two variaables
without anyother variable----->


Dear friends,
I have one query.

"Write a program to exchange two variables without any other variable?"
Program should be in C or C++

Please if anyone knows then solve and reply me.

Thanks in advance.

good bye








SPONSORED LINKS Basic programming language Computer programming languages
Programming languages
Java programming language


------------------------------------------------------------------------------
YAHOO! GROUPS LINKS

a.. Visit your group "AspNetAnyQuestionIsOk" on the web.

b.. To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


------------------------------------------------------------------------------



[Non-text portions of this message have been removed]



SPONSORED LINKS
Basic programming language Computer programming languages
Programming languages Java programming language

---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------






Thanx

Sam Hansh
Impossible itself consists "I M POSSIBLE".


---------------------------------
Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays,
whatever.

[Non-text portions of this message have been removed]





---------------------------------
YAHOO! GROUPS LINKS


Visit your group "AspNetAnyQuestionIsOk" on the web.

To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


---------------------------------





Send instant messages to your online friends http://in.messenger.yahoo.com

[Non-text portions of this message have been removed]
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help