English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

for e.g 3246 mltiply it or divide it by some number so
it gives me 6 for ones or 4 for hundreds

2006-10-28 15:13:01 · 7 answers · asked by Haruhi 1 in Science & Mathematics Mathematics

7 answers

The ones digit (of any number x) is easy.
It is = x (mod 10) (i.e., it is the remainder of the number upon division by 10. For example, 3246 (mod 10) = 6 because 3246/10 = 324 Remainder=6)

The tens digit requires a little more.
If you use int(x), (which is the greatest integer ≤ x function and is used in many computer programming languages), then the tens digit of any number x is:

int(x/10) (mod 10)

In your example,
3246/10 = 324.6
int(324.6) = 324
324 (mod 10) = 4

2006-10-28 15:57:05 · answer #1 · answered by Scott R 6 · 0 0

Multiplying by 1 or 6 gives you a 6 for the ones digit.
Multiplying by 2 gives you a 4 for the hundreds digit.

2006-10-28 22:41:02 · answer #2 · answered by Anonymous · 0 1

Try this expression for a given integer x and place position n where units =1, tens=2, etc

d = int((x-10^n*int(x/10^n))/10^(n-1))

where d is the digits. The mathematical operators have their usual meaning and int is the integer part function eg int(1.2) =1

For example x=1234 and n=2 will return d=3

Have fun. Onya....

2006-10-29 01:08:05 · answer #3 · answered by A S 4 · 0 0

The ones :
x - (x/10)*10

3246 - (3246/10)*10 = 3246 - 324*10 = 6

you divide and ignore the remainder.

2006-10-28 23:53:27 · answer #4 · answered by gjmb1960 7 · 0 1

Let n be the number.

Units digit = n - 10 * INT(n / 10)

Tens digit = INT(n / 10) - 10 * INT [ INT(n / 10) / 10]

or what may be easier to do and see :

First, let x = INT(n / 10), then :

Units digit = n - 10x

Tens digit = x - 10 * INT(x / 10)

You can keep on doing this.

Now let y = INT(x / 10)

The hundreds digit is then : y - 10 * INT(y / 10)

Of course, the starting digit of a 4-digit number
can always be calculated by : INT(n / 1000)

2006-10-29 00:06:04 · answer #5 · answered by falzoon 7 · 0 1

You can divide it by 10 and subtract off the part that is to the left of the decimal and then multiply by 10.

2006-10-28 22:18:26 · answer #6 · answered by Anonymous · 0 1

it is just what number in the order they are in. 3thousand 2hundrad 4tens and 6ones.

2006-10-28 22:16:31 · answer #7 · answered by mouses_moyer 2 · 0 1

fedest.com, questions and answers