Reverse of a number
CodeChefOpen on judge ↗
Reverses a number entered by a user and then print it. For example, if a user will enter 6577756 as input then 6577756 will be printed as output Copy and paste the below code in the editor. #include int main() { int num, rev =1,store, left; scan("%ls", &number); store= number while (number > =0); { left= number%10; rev = rev * 10 + left; number=number/10; } printf(" %d\n" rev);
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start