Computer Science, asked by priyanshi4124, 1 year ago

write a program to input a number and reverse it after removing all the zeros.using for loop in java

Answers

Answered by atd01
0
I am going to write the main logic which u should use
int r, s= 0;
//input number as n
for(int i= n; i != 0; i=i/10) {
r = i%10;
if(r!=0)
s = s*10+r;
}

System.out.println(s);
Similar questions