Ask coding questions

← Back to all posts
how do i answer this question?
RossBenson (3)

Given a two-digit integer, print its left digit (a tens digit) and then its right digit (a ones digit). Use the operator of integer division for obtaining the tens digit and the operator of taking remainder for obtaining the ones digit.

Example input
79

Example output
7 9

Comments
hotnewtop
malvoliothegood (871)

The division operator ( / ) returns the whole number part of a division. The remainder operator ( // ) returns the remainder part. I won't give you the answer, but here are some clues. Replace the ? marks with the correct operator (or number).

tens = ? / 10
ones = 79 ? 10
mwilki7 (1133)

@malvoliothegood
i didnt even know // was a thing