multiplying step by step

Martin0027's Avatar, Join Date: May 2011
Light Poster
Hi, I need advice on how to multiply and store numbers in the box that way: 125 * 125 split to 125 * 5 (put in field1) 125 * 2 ​​* 10 (put in field2) 125 * 1 * 100 (put in field3) and then all added together and printed on a desktop.
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
You could use the modulo operator:
Code:
int x=125 % 10;
int y=(125/10) % 10;
results in x containing 5 and y 2.
0
Chong's Avatar, Join Date: May 2011
Go4Expert Member
Hi
What is your question? Is it your discovery or you mean to ask something?

Best regards
Chong
0
Chong's Avatar, Join Date: May 2011
Go4Expert Member
Hi
I am sorry that you were giving a solution. I am new to this webiste and leraning how to use this website.
Best regards
Chong
0
Martin0027's Avatar, Join Date: May 2011
Light Poster
but how do I resolve read from the command line, I do not know how I enter the digits
it would need to take that number from the back %10, erase the last digit and %10 again to get all the numbers what they are?
could it be? or which functions i should use?