Arduino
Home
Buy
Download
Products
Arduino
AtHeart
Certified
Learning
Getting started
Examples
Reference
Playground
Forum
Support
FAQ
Contact Us
Blog
LOG IN
SIGN UP
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 657 times)
previous topic

next topic
joexusun
Newbie
Posts: 11
[add Karma]
Logged
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: 52,179
Karma: 677
Location: Seattle, WA USA
[add Karma]
Logged
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.
joexusun
Newbie
Posts: 11
[add Karma]
Logged
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...