¿Como almacenar distintos datos en una variable? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

¿Como almacenar distintos datos en una variable?

lo que quiero es que en una variable donde se piden dos datos ,es almacenada quiero saber como puedo dividir estos datos

19th Oct 2018, 6:34 PM
Bannana
Bannana - avatar
3 Answers
+ 1
Depende del idioma y los datos que esté almacenando. Puedes guardar dos números del 0 al 9 multiplicando el primero por 10 y sumando el segundo. Para dividirlos, puede dividir el número combinado por 10 para obtener el primero y usar el operador de módulo para obtener el segundo.
20th Oct 2018, 6:45 PM
John Wells
John Wells - avatar
+ 2
Excelente 👍
1st Nov 2018, 12:57 PM
Lana Maria
Lana Maria - avatar
+ 1
It depends on language and data you are storing. You could store two numbers 0 to 9 by multiplying the first by 10 and adding the second. To split them, you could divide the combined number by 10 to get the first and use the modulus operator to get the second.
20th Oct 2018, 6:44 PM
John Wells
John Wells - avatar