lunes, 19 de septiembre de 2016

Convertir ńumero entero a Hexadecimal con Hex()



' Gambas module file

' by postapase
' http://novatocodegambas.blogspot.com.uy/

'Reto: http://www.solveet.com/exercises/decimal-a-hexadecimal-/605

' Crear una función que tome un entero y devuelva una cadena con su conversión a hexadecimal.
'
' ejemplo:
' hex 2 = "2"
' hex 10 = "A"
' hex 666 = "29A"

Public Sub Main()

Print ConvertirNumero_A_Hexadecimal(2)
Print ConvertirNumero_A_Hexadecimal(10)
Print ConvertirNumero_A_Hexadecimal(666)

End

Private Sub ConvertirNumero_A_Hexadecimal(numeroX As Integer) As String

Return Hex(numeroX)

End



No hay comentarios.:

Publicar un comentario