Computer Science, asked by likithusp1647, 11 months ago

Write a program in java to accept a number form user and print a new number after removing all zeros.

Answers

Answered by sayan0000
0

Answer:

import java. until. *;

class abc

{

Void main()

{

Scanner sc=new scanner(system. In) ;

System. Out. Print("enter a number") ;

Int n=sc.nextint();

Int s=0;

While(n!=0)

{

If(n%10!=0)

S=s+n%10;

N=n/10;

}

System.out.print("new number=" +s) ;

}

}

Correct all syntax errors

Similar questions