ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

VB.Net program to demonstrate the Hex() function

Here, we are going to demonstrate the Hex() function in VB.Net.
Submitted by Nidhi, on December 04, 2020

The Hex() function is used to get the Hex value corresponding specified number.

Syntax:

Hex(num)

Parameters:

  • num: Specified integer number.

Return Value:

The Hex() function will return the Hex value corresponding specified integer number.

Program/Source Code:

The source code to demonstrate the Hex() function is given below. The given program is compiled and executed successfully.

'VB.Net program to demonstrate the Hex() function.

Module Module1

    Sub Main()
        Dim val As Integer = 13
        Dim hexVal As String = ""

        hexVal = Hex(val)

        Console.WriteLine("Hex value: {0}", hexVal)
    End Sub

End Module

Output:

Hex value: D
Press any key to continue . . .

Explanation:

In the above program, we created a module Module1 that contains a Main() method. In the Main() method, we created two variables val and hexval. Here, variable val is initialized with 13 and variable hexVal is initialized with a blank string.

hexVal = Hex(val)

In the above code, we used the Hex() function that will return the Hex value corresponding to the specified integer number. Then we printed the character on the console screen.

VB.Net Basic Programs »



ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.