write a java program to enter a number. print the place value of its each digit.
Answers
Answered by
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
Math,
6 months ago
World Languages,
6 months ago
Computer Science,
6 months ago
Hindi,
1 year ago
Math,
1 year ago
Chemistry,
1 year ago