Computer Science, asked by rakhijaiswal0608, 2 months ago

write a program to input a number and arrange the digits of the number in ascending order​

Answers

Answered by LoveAman
0

Answer:

hope it helps you

class orde

{

static void buncy(int num) {

for(int i=1;i<=9;i++)

{

int c=0; int n=num;

while(n!=0)

{

if(n%10==i)

{ c++;break;

}

n/=10; }

if(c>=1)

System.out.print(i+” “); } } }

Answered by CopyThat
5

Answer:

JAVA :-

Explanation:

class Brainly

{

static void main(int n)

{

int i,s=0,c=0,d,j;

for(i=9;i>=0;i--)

{

for(j=n;j>0;j=j/10)

{

d=j%10;

if(d==i)

s+=d*(int)Math.pow(10,c++);

}

}

System.out.println(“New number=”+s);

}

}

Similar questions