Jul 19, 2013 at 2:21pm UTC
How do I reverse decimal numbers?
ex : 2.369 => 963.2
Meanwhile without strings
Please help me!
Last edited on Jul 19, 2013 at 2:48pm UTC
Jul 19, 2013 at 2:22pm UTC
read it into a string, reverse the string, put it in a string stream, and stream into a float
Jul 19, 2013 at 2:24pm UTC
please enter the code
but With no strings
Last edited on Jul 19, 2013 at 2:28pm UTC
Jul 19, 2013 at 2:26pm UTC
im not going to code it for you
Jul 19, 2013 at 2:32pm UTC
why?
So just get guide how to get it without strings
please!
Jul 19, 2013 at 2:35pm UTC
ill write you some pseudo code
Jul 19, 2013 at 2:36pm UTC
Which part is causing the problem?
1. read it into a string
2. reverse the string
3. put it in a string stream
4. stream into a float
Have you tried to do any of these steps for yourself?
Actually - it depends upon exactly what is your starting point - e.g. the decimal number comes from keyboard input, or from the result of a calculation etc. And similarly, do you need to do any calculations with the resulting value? As it stands the question isn't very precisely framed.
Last edited on Jul 19, 2013 at 2:39pm UTC
Jul 19, 2013 at 2:41pm UTC
chervil
tnks
but i want without string
Jul 19, 2013 at 2:43pm UTC
@DTSCode :
i don't use pseudo code much, but this looks like a C++ program with compile errors ;)
Jul 19, 2013 at 2:49pm UTC
you can split the number into digits, and store them in an array of ints or doubles.
Last edited on Jul 19, 2013 at 2:49pm UTC
Jul 19, 2013 at 2:51pm UTC
i cant think of a way with all of the algorithims i know to do it with out strings. not to say it cant be done, but i dont know how.
Jul 19, 2013 at 2:55pm UTC
What do you mean by "without strings"
Do you mean without std::string? Windows CString? C-style strings? Please try and be precise so we can help you.
Jul 19, 2013 at 3:00pm UTC
Should be simple
wihtout string,class,...
Jul 19, 2013 at 3:01pm UTC
its not simple. why cant you use strings?