Your task is to write a program that will take as input an integer, and swap its left half with itsright half.

Joined
Sep 24, 2022
Messages
1
Reaction score
0
Note that if the length of the integer is odd, then the left half will contain the digit in
the exact middle position (for example: the left half of 65237 is 652, and the right half is 37).

Sample Input: 984897 > Sample Output: 897984
Sample Input: 65237 > Sample Output: 37652
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top