ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

VB.Net program to print backslash (\) character on the console screen

Here, we are going to learn how to print backslash (\) character on the console screen in VB.Net?
Submitted by Nidhi, on November 26, 2020

We will create a program in VB.Net to print backslash (\) character using a double backslash "\\" character on the console screen.

Program/Source Code:

The source code to print backslash (\) character on the console screen is given below. The given program is compiled and executed successfully.

'VB.Net program to print backslash (\) character 
'on the console screen.

Module Module1
    Sub Main()
        'printing "\" 
        Console.WriteLine("\\")

        'printing between the string "\"
        Console.WriteLine("Hello\\World")

        'printing "\"n and "\"t
        Console.WriteLine("\\n\\t")

        'hit ENTER to exit the program
        Console.ReadLine()
    End Sub

End Module

Output:

\\
Hello\\World
\\n\\t

Explanation:

In the above program, we created a Module that contains the Main() method, here we used the WriteLine() method of Console class to print the message on the console screen. Here, we used double backslash "\\" to print backslash 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.