Subj : Re: Math error ??? doen't make sense! To : borland.public.cpp.borlandcpp From : Sebastian Ledesma Date : Fri Jul 02 2004 12:36 am Stan: If you are using 16 bit apps (you can make DOS app's with BC5.02) the int's size are 16 bits. So the largest number you can handle is +-2^15 -1 for signed values ( or 2^16-1 for unsigned), you can switch your variables to long in order to get the real result, also you can make a Win32 console app, in such case the int's are 32 bit wide. Saludos Sebastian "Stan DeGroff" escribió en el mensaje news:40e4c012@newsgroups.borland.com... > I Programmed in Assembly, Fortran, DbaseIV, MS Prof Basic pre-Win for many > years. > This new stuff is mind blowing. So.. I ask for your patient help. > > I am using the Sam's Learning C in 24hr book that came with my new > Bc++ 5.02 compiler. (I need to learn it from ground up.) > Reason for using old software is simple. I need to target 16bit embedded > computer. > > Ch 9 Exercise 3 > ------------------- > > #include > #include > main() > { > int x,y; > long int z; > > x=7000; > y=12000; > z=x*y; > > printf("x * y == %lu\n",z); > > return 0; > } > -------------------------- > > the above code should print 84000000. > It doen't. I got 4294950144 > .