/home/caleb/ASDV-Java/Semester 3/Assignments/lab5-recursion2_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/lab5/recursion2_calebfontenot/ReverseInt.java
/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package edu.slcc.asdv.caleb.lab5.recursion2_calebfontenot;

import java.util.Scanner;

/**
 *
 * @author caleb
 */
public class ReverseInt {
    public static void main(String[] args)
    {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter an integer: ");
        int i = input.nextInt();
        System.out.print("The reversal of " + i + " is ");
        reverseDisplay(i);
        System.out.println();
    }
    public static void reverseDisplay(int value) {
        if (value != 0) {
            System.out.print(value % 10);
            value = value / 10;
            reverseDisplay(value);
        }
    }
}