ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

VB.Net program to demonstrate the Asc() function

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

The Asc() function is used to get the ASCII value corresponding specified character.

Syntax:

Asc(character)

Parameters:

  • character: It is a string that contains a single character.

Return Value:

The Asc() function will return the ASCII value corresponding specified character.

Program/Source Code:

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

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

Module Module1

    Sub Main()
        Dim num As Integer = 0

        num = Asc("c")

        Console.WriteLine("Ascii value: {0}", num)
    End Sub

End Module

Output:

Ascii value: 99
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 a variable num, which is initialized with 0.

num = Asc("c")

In the above code, we used the Asc() function that will return the ASCII value corresponding to the specified character. 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.