Posted: 10/10/2005 3:49:09 PM EDT
|
Write a program that inputs a five digit integer, seperates the integer into its individual digits seperated by three spaces each they give a hint[use the integer division and modulus operators . for example type int 42339 then it should print 4 2 3 3 9 I need to learn how to seperate an integer number. how do you seperate an integer? is it possible to seperate a single integer! |
Strings are infinitly more easy to manipulate then any other data type. |
use division and strip the remainder 42339 divied by 10000 you get 4.2339 strip the .2339 then subtract (4 * 10000) from 42339 you get 2339 divied by 1000, you get 2.339 strip the .339 repeat untill your at base unit position and this isn't a c++ quiestion, the is basic programming. peroid. and i have to master basic spelling. |
To me that is the hardest part, so i don't see what your problem is anymore.
|
me neither |
I'm guessing he's having a problem seperating the 4 from the 2 from the 3 from the 3 from the 9? If thats the problem, he probably needs to pay more attention to the thread. |
| I was going back through some basic programming skills and doing the excercises! I just had a problem with this one question! the text does not show an example on how to seperate an single integer. all i ask was for some help on this, not harrassment on how stupid i am! |
You said you already know how to seperate the number into inidividual integers, and not you say you can not. which is it? As for the stupid part: This is the Internet. There are millions of people with nothing better to do but belittle others.
|