--- Ananth <[EMAIL PROTECTED]> wrote:

> Thomas Hruska <[EMAIL PROTECTED]> wrote:
> > parrot_rabbit4u wrote:
> >  > --- In [email protected], senthil kumar
> <[EMAIL PROTECTED]>
> >  > wrote:
> >  >> #Iinclude<iostream.h>
> >  >>   #include<conio.h>
> >  >>   main()
> >  >>   {
> >  >>    int a,b,c;
> >  >>   clrscr();
> >  >>   cout<<"enter the number:";
> >  >>   cin>>a>>b;
> >  >>   c=a-(-b);
> >  >>   cout<<"The add value:"<<c;
> >  >>   getch();
> >  >>   return 0;
> >  >>   }
> >  >>
> >  >> ur program will definetly work with out using '+' operator.
> >  > thanks for ur this idea.
> >
> >  This is fundamental math.  Of the lightweight elementary school
> 'Algebra
> >  I' variety.  I still don't know why the OP thought they needed to
> do
> >  this...
> 
> To answer a trick question?
> If learning C++, to impress friends and classmates?
> Should be one of the two.

Le me throw in my 2p too...

Putting a+b as a - ( -b ) is not impressive. See this:

for(i=0;i<b;i++){
    a++;
}

OR

while(b){
    a++;
    b--;
}

and put these marvels in a class:

class intAddNoPlus
{
/* blah */
    int a,b; /* our VIPs */
    public:
    int add()
    { 
        /* Select your favourite algo and return */
    }
};

Regards,
Mohan S N




       
____________________________________________________________________________________
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for 
today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow  

Reply via email to