split numbers

Hi everyone,

I searched the forum, but i am not really sure how to search, i guess i dont know the exact words... but my question is; can i split numbers?

example of what i am looking for;

if val=86
number1 would then be a 8
number2 would then be a 6

any help or pointing me into the right direction would be very much appriceated

number1 = val / 10;
number2 = val % 10;

Assumes val is integer and less than 100.

-j

of course...stupid me...

thank you very much!

of course...stupid me...

We seem to have a policy around here of discouraging people from beating themselves up. Please don't beat yourself up when learning things, it's unlikely to be good for you. :slight_smile:

--Phil.

Yeah, everything is easy if you already know the answer. :slight_smile: What's that rule, the only stupid question is the one you don't ask?

-j

Since we've now resolved the debate on stupid vs. non-stupid questions, it's time to consider what determines a "frequently asked" question.

Doesn't it seem funny that people post never-before-asked questions on the "frequently asked questions" forum? I mean, the fact that your question is not among the 1435 already posted there would seem to prove that it isn't "frequently asked" and therefore doesn't belong. Conclusion: it is never appropriate to post anything in that forum.
:slight_smile:

Mikal

it's time to consider what determines a "frequently asked" question.

Doesn't it seem funny that people post never-before-asked questions on the "frequently asked questions" forum? I mean, the fact that your question is not among the 1435 already posted there would seem to prove that it isn't "frequently asked" and therefore doesn't belong. Conclusion: it is never appropriate to post anything in that forum.

Since all the questions in that forum boil down to either :
“ How do I do ?.”
or
“ I tried this but it doesn't work, please help”

I would think the category is aptly named

I was going to suggest a special category for:
“error: expected unqualified-id before 'int'”

But mellis has threatened to fix that in 0013.

:slight_smile: