# Thread: Stupid easy noob question.

1. ## Stupid easy noob question.

Hi, i've tried look about for this but cant find it .

Basically all i want to do its break a number up into single ints.

I.E

id have

int a
int b
int c

and a number, say 189. I want break 189 into 1,8 and 9. So a=1 b=8 and c=9.

thanks for any help.

2. Use math, specifically division and modulus. What's (189 / 100) &#37; 10 in integer math? It's 1. What's (189 / 10) % 10? It's 8. What's (189 / 1) % 10? It's 9.

3. Originally Posted by Daved
What's 189 % 100? It's 9.
89..

4. oh, so i cant just break it up you can in java?

5. If "189" is a string, then yes you can parse it out. You implied 189 was an integer by calling it a number, (and because you didn't put double quotes around it), thus you got a math solution.

6. Of course you can, and Daved explained how.

7. yeah it is an int i will be reading in.

so there is no classes to do this sort of thing? sorry im a noob at c++

in java i would just use the scanner and nextInt()

```string num("189");