Arduino Forum
>
Using Arduino
>
Programming Questions
>
How do I combine two singledigit numbers into one doubledigit number?
Print
Go Down
Pages:
[1]
Topic: How do I combine two singledigit numbers into one doubledigit number?
(Read 1 time)
previous topic

next topic
joexusun
Guest
How do I combine two singledigit numbers into one doubledigit number?
Nov 25, 2012, 08:22 pm
How do I combine two singledigit numbers into one doubledigit number?
For example, I have "2" and "3" as two singledigit numbers, and I want to make a double digit number "23". All these three numbers are "int" type.
PaulS
Brattain Member
Posts: 78,656
Karma: 2159
[add]
Seattle, WA USA
Re: How do I combine two singledigit numbers into one doubledigit number?
#1
Nov 25, 2012, 08:28 pm
Write them down on a piece of paper. Notice how you put one number in the ones column and the other number in the tens column.
Then, look up how to multiply one number by 10. It isn't rocket science.
The art of getting good answers lies in asking good questions.
joexusun
Guest
Re: How do I combine two singledigit numbers into one doubledigit number?
#2
Nov 25, 2012, 09:33 pm
ehhh... That is right! I was thinking shift bits and that kind of stuff.. Thanks
Print
Go Up
Pages:
[1]
Loading...