Commit d65d4fa
committed
feat: Implement logic to reverse a given number using modulus and division
🧠 Logic:
- Extract digits from the number using `% 10`.
- Build the reversed number by multiplying `rev` by 10 and adding the digit.
- Repeat until the original number becomes 0.
- Print the reversed number at the end.
Signed-off-by: Somesh diwan <[email protected]>1 parent 717d539 commit d65d4fa
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
0 commit comments