+ 3
Need to separate numbers
Need to separate numbers. (For example) Int A=256; 2 5 6 Thank you very much
3 odpowiedzi
+ 16
divide the number by increasing 10^n
//n goes from number of digits to 1
//thats basic approach , or u can convert no. to String & use charAt ()
+ 2
In javascript :
var number = 256;//or an input from the user
number = '' + number;
var result = number.split('');//split is a method to separate a string into an array using a separator (no separator = separate every character)
Hope that it will help you