Professional Documents
Culture Documents
Predefined function:
ASC and CHR
ACS returns the ASCII value of a character.
CHR returns the character of a given ASCII
Module Module1
Sub Main()
Dim ch As Char
Dim AsciiValue As Integer
End Module
Qu2 Write a program to enter an ASCII value and then display its corresponding a character.
Module Module1
Sub Main()
Dim ch As Char
Dim AsciiValue As Integer
Console.WriteLine(" Enter an ASCII value")
AsciiValue = Console.ReadLine
ch = Chr(AsciiValue)
Console.WriteLine("The character of the ASCII value " & AsciiValue & " is " &
ch)
Console.WriteLine("Press Any Key to continue...")
Console.ReadKey()
End Sub
End Module
Qu write a program to enter 100 digits and then output the number of each digit entered.
Dim Digit, index as Integer
Dim Counter(10) as integer
Dim ch as char
Dim index as integer
Dim counter(25) as integer