Pages: [1]   Go Down
Author Topic: How do I combine two single-digit numbers into one double-digit number?  (Read 307 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How do I combine two single-digit numbers into one double-digit number?

For example, I have "2" and "3" as two single-digit numbers, and I want to make a double digit number "23". All these three numbers are "int" type.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 547
Posts: 45973
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ehhh... That is right! I was thinking shift bits and that kind of stuff.. Thanks
Logged

Pages: [1]   Go Up
Jump to: