in Education by
write a program in java to accept a number and display the new number after removing all the zeros Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Answer: //Write a program to accept a no. & display the new number after removing all zeros. class Zero { public static void main(int n) { int rem=0,p,x,z=0,r=0,rev=0; while(n>0) { rem=n%10; if(rem==0) { x=rem; } else { p=rem; rev=rev*10+p; } n=n/10; } while(rev>0) { z=rev%10; r=r*10+z; rev=rev/10; } System.out.println(“The new no.=”+r); } } Explanation: Hope u understand it

Related questions

0 votes
    write a program to accept a word and display the new word after removing all the repeated alphabet Select the correct answer from above options...
asked Dec 25, 2021 in Education by JackTerrance
0 votes
    Write a program to accept a filename from the user and display all the lines from the file which contain python comment character ‘#’. Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    write a Java program to accept a full name and display the initials along with the surname. URGENT! give the full program please Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    write a java program to accept alphabet and find out vowel or consonant Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    Write a C program to accept an integer number between 1 and 9. Write the value of the number in words. Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
0 votes
    the angles of a square are in ratio 4:4:4:4 . write a program to find and display all of its angels Select the correct answer from above options...
asked Dec 25, 2021 in Education by JackTerrance
0 votes
    Write an algorithm to accept radius of a circle from user, and display area of the circle using the formula: area ... x radius x radius Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    rewrite the following code in Python after removing all the syntax error underline is correction done in code a,b=2 ... print( end') Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    Q 5 Rewrite the following code in python after removing all the syntax errors. Underline each correction done in ... a logical operator Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    rewrite the following code in Python after removing all the syntax error underline is correction done in code a,b=2 ... print( end') Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    write a Java program to input 10 non-zero numbers in an array and display the count of even and odd numbers. URGENT! Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    Write a JAVA program to store the marks of any 5 subjects in different variables. Calculate total and average. ... ANY INPUT METHOD Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    Write a JAVA program to find the area and perimeter of a square and rectangle. Store side in s , length as ... USE ANY INPUT METHOD Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    Write a JAVA program to find the area and perimeter of a square and rectangle. Store side in s , length ... results in separate lines. Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
...