CFanatic

Go Back   CFanatic > Programming > C++ Programming

Join CFanatic Forum Now

Paper Pencil Method of Multiplication topic posted under C++ Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 09-04-2010, 11:11 PM
Junior Member
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
anniefaty is on a distinguished road
| More
Paper Pencil Method of Multiplication

can some one get me started on this c++ assignment.

This lab is mainly an output-formatting exercise. It does require that you know how to develop the product of two integers, without using a calculator.

Problem statement
Write a program that multiplies two 4-digit positive integers and prints their product in the format below. Your program should ask the user to type the two numbers, then read them in. As an example, the product of 4560 and 4334 should produce the following output.
Notice that the alignment should be the same as you’d get if you multiplied the numbers using a pencil and paper.

4560
x 4334
---------
18240
13680
13680
18240
---------
19753920

You have to pull out the digits of the top number. 1000th digit is ‘4’. So you’d then multiply ‘4’ time 4334. There are different ways of solving this.
Reply With Quote
  #2  
Old 09-05-2010, 02:22 AM
coderzone's Avatar
Senior Member
 
Join Date: May 2007
Posts: 273
Thanks: 16
Thanked 12 Times in 12 Posts
coderzone is on a distinguished road
| More
Re: Paper Pencil Method of Multiplication

You have to split the digit but getting the each digit.

You have to divide by 10 and extract the remainder and then multiply it with the original number.

Repeat the same for all digit and then display them.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
get method spikestar C++ Programming 0 08-31-2010 04:11 AM
how to reverse a string by using array method.? gahhon C Programming 0 08-28-2010 03:11 AM
how to reverse a string by using array method.? gahhon C Programming 0 08-28-2010 03:11 AM
find the output in pen and paper. pkbis28 C Programming 4 05-31-2010 01:57 AM
Simplex Method techinspiration C Programming 2 02-18-2010 10:06 PM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 02:47 AM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board