Question: import java.util.Scanner; public class TASK3 { public static void main(String[] args) { int num,n=0; Scanner kb = new Scanner(System.in); do { System.out.println(enter an integer >=

import java.util.Scanner;

public class TASK3 {

public static void main(String[] args) {

int num,n=0;

Scanner kb = new Scanner(System.in);

do {

System.out.println("enter an integer >= 1 ");

num= kb.nextInt();

if(num

System.out.println("Error: invalid input ! ");

}while (num

while( num != 0 )

{

n = n * 10;

n = n + num%10;

num = num/10;

}

System.out.println("the integer entered is"+num+","+"its reverse is:"+n);

}

}

import java.util.Scanner; public class TASK3 { public static void main(String[] args) {

why i get 0

enter an integer = 1 653 the integer entered is e,its reverse 1s:358

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!