import java.util.Scanner;
public class ReverseOfNumber {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in); // use for input from user
int num = sc.nextInt();
// int num = 10899;
while (num > 0) {
int lastDigit = num % 10;
System.out.print(lastDigit);
num = num / 10; // n/10;
}
System.out.println();
}
}
import java.util.Scanner;
public class ReverseOfNumber {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in); // use for input from user
int num = sc.nextInt();
// int num = 10899;
while (num > 0) {
int lastDigit = num % 10;
System.out.print(lastDigit);
num = num / 10; // n/10;
}
System.out.println();
}
}
No comments:
Post a Comment