+ 2
How can i seperate a long number like int numb= 233 into int a=2 int b= 3 int c=3
6 odpowiedzi
+ 4
You should cast to string the given number and convert to integer each character composing the string
+ 4
Sure, try this! ;)
https://code.sololearn.com/cxLR8fnnn9u8/?ref=app
+ 4
you could store each single integer to an array
+ 2
if you have to make operations on the results try this:
int bigNumber = 321;
int a = bigNumber/100; //a is 3
bigNumber-=a*100; //bigNumber is 2(321-300)
int b = bigNumber /10; // b is 2
int c= bigNumber-b*10; //c is 1 (21-20)
+ 2
michael how can i use the variables so i can use them in a formel like 233=int a int b= 2 int c =3 int d =3 b*3 +c*5+d*9=sum
+ 1
can you pls give me a exemple