This website completely moved to new platform. For latest content, visit www.programmingposts.com

Search this Site

7 Sept 2013

VB.NET Program to Print Love Symbol

Module Module1

    Sub Main()

        Dim a As Integer = 3, i As Integer
        Console.WriteLine("www.ProgrammingPosts.blogspot.com")
        Console.WriteLine(vbLf & " >>VB.Net PROGRAM TO PRINT LOVE SYMBOL <<" & vbLf)
        For i = 0 To 249
            'for loop prints love symbol 250 times
            Console.Write(ChrW(a))
        Next
        'Console.Write((char)3) 'this also prints the same
        Console.ReadKey()

    End Sub

End Module

 Output :
 

Explanation : Actually here we are printing the ASCII smbol of 3 . Which gives a love symbol.
you can also print directly by writing the following code.

  Console.Write(Convert.ToChar(3))  or  Console.Write(ChrW(3))

No comments:

Post a Comment

Thanks for your comments.
-Sameer