You are not logged in.

#1 2009-06-12 03:32:35

wankel
Member
From: Iowa, USA
Registered: 2008-05-30
Posts: 218
Website

Multiplication program in c

Hey guys, I have another c related question for you guys. Im writing a program that does basic multiplication of two numbers. However, Im trying to make the output look like as if it were done by hand, the following is an example of this:

       965
x     1728
----------
      7720
+    19300
+   675500
+   965000
----------
   1667520

Can anyone get me in the right direction as far as the output goes? I know how to take in the 2 numbers and provide the product, but Im not sure how to get the the 7720, 19300, etc lines like it shows in the example. I appreciate all the help provided, thanks guys!

Offline

#2 2009-06-12 03:37:09

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,485
Website

Re: Multiplication program in c

This sounds like homework....  it is policy to close it unless you can convince me otherwise.







(hint: integer division and modulus)

Online

#3 2009-06-12 11:00:18

timetrap
Member
From: Here and There
Registered: 2008-06-05
Posts: 342
Website

Re: Multiplication program in c

I was just thinking the same thing.

Go try yahoo answers. It's like a homework machine.

Offline

#4 2009-06-12 12:26:03

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Multiplication program in c

Yeah, I'm just going to go ahead and lock this.  Allan's given a great hint.

Offline

Board footer

Powered by FluxBB