Number Splitter Program
Posted by rjndhl1
Last Updated: January 23, 2015
  766

// Number Splitter Program

package number_splitter;
import java.util.Scanner;

public class number_splitter {
	public static void main( String [] args){
		Scanner input = new Scanner( System.in);
		System.out.println(" Enter the number");

		int num = input.nextInt();
		
		int number9 = num /100000000% 10; 
		int number8 = num /10000000% 10; 
		int number7 = num /1000000% 10; 
		int number6 = num /100000% 10; 
		int number5 = num /10000% 10; 
		int number4 = num /1000 % 10; 
		int number3 = num /100 % 10; 
		int number2 = num /10 % 10;
		int number1 = num % 10;
		
		
		
		System.out.println("The digit in the one place is  "    + number1);
		System.out.println("The digit in the ten place is  "    + number2);
		System.out.println("The digit in the hundred place is "        + number3);
		System.out.println("The digit in the thousand place is "           + number4);
		System.out.println("The digit in the ten thousand place is  "           + number5);
		System.out.println("The digit in the 100 thousand place is  "           + number6);
		System.out.println("The digit in the million place is  "           + number7);
		System.out.println("The digit in the ten million place is  "           + number8);
		System.out.println("The digit in the billion place is  "           + number9);
		
		
	}

}