15,356,641 members
1.00/5 (4 votes)
See more:
I want to know how to write the code

What I have tried:

`I did not reach an effective result`
Posted
Updated 19-Jul-20 13:30pm
v2

## Solution 1

On paper, think about how you go about reversing a number.

You can do this using nothing but math, or you could do it using strings.

But, in any case, we're not going to do it for you. Your big problem is going to be YOU have to explain how the code works, so YOU have to come up with the way to do it.

## Solution 2

Take 12345.
A division by 10 gives 1234 and the reminder is 5.
The operation modulo gives the reminder of a division.
This is all what you need.
Comments
BillWoodruff 21-Jul-20 0:26am

voted #1: an absurd response to an obvious homework question.
Patrice T 21-Jul-20 3:43am

Ok, noted, at least you have the courage to leave a comment.
Only gave a lead to solution as it is an obvious homework.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Top Experts
Last 24hrsThis month
 Chris Copeland 130 k5054 60 Member 15696202 40 Kong Lee 2022 35 Richard MacCutchan 35
 OriginalGriff 480 CPallini 200 Chris Copeland 155 0x01AA 140 Daniel Pfeffer 70

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900