Computer Science, asked by guptanirmal885, 9 months ago

write a java program to enter a number.  print the place value of its each digit.​

Answers

Answered by mn121
13

import java.util.*;

public class place_value

{

public static void main(String[] args)

{

Scanner in = new Scanner(System.in);

int n,i,d,c=1,pv;

System.out.println("Enter a number: ");

n = in.nextInt();

System.out.println("Digit"+"\t"+"Place Value");

for(i=n;i!=0;i=i/10)

{

d=i%10;

pv =d*c;

c=c*10;

System.out.println(d+"\t"+pv);

}

}

}

// Hope it helps you...

Please mark it as brainliest...

☺️☺️☺️

#BAL

#AnswerWithQuality

Similar questions