public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number:");
int num = sc.nextInt();
int rev = 0;
for (int i = 1; i <= num; i++) {
int rem = num % 10;
num = num / 10;
rev = rev * 10 + rem;
}
System.out.println(rev);
}
package com.dain.logics;
import java.util.Scanner;
public class Reversenumber {
}