comprogzz coding

Observe the following coding in java. let the entered number be 108. find the output:- hint - log on to comprogzz.in/javageneral20.html

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.io.*;
             class General20{
               public static void main(String args[])throws IOException
                  {
                     int n;
                      InputStreamReader isr=new InputStreamReader(System.in);
                      BufferedReader br=new BufferedReader(isr);
                     do{
                      System.out.println("Enter a number");
                      n=Integer.parseInt(br.readLine());
                     }while(n<=9);
                     for(int i=9;i>=1;i--)
                    {
                    int a=n;
                    while(a>0){
                     int b=a%10;
                      if (b==i)
                      System.out.print(b+" ");
                       a/=10;
                      }
                    }
                  }
            }

×

Problem Loading...

Note Loading...

Set Loading...