Next Line in C#

C Sharp program to print the nextline. The string “This is C#” is printed to the console in this code line. The WriteLine function of the Console class is used to print a message to the console. For console applications, this class represents the standard input, output, and error streams.

using System;
using System.IO;
using System.Text;

namespace Inlarn
{
class Test
{
static void Main(string[] args)
{
Console.WriteLine("Hello\nWorld");
Console.WriteLine("Hello\x0AWorld");
Console.WriteLine();
Console.ReadLine();
}
}
}

 

Output:

Hello
World
Hello
World

What is System.IO Namespace in C#

The System.IO namespace comprises IO-related classes, structures, delegates, and enumerations. Data can be read and written to and from files and data streams using these classes. There are types here that allow you to read and write to files and data streams, as well as types that provide basic file and directory operations.

Using system.text for c sharp program

Namespace for text. There are classes that represent ASCII and Unicode character encodings, as well as abstract base classes for converting blocks of characters to and from blocks of bytes and an utility class that manipulates and formats String objects without the need for intermediate String instances.

What is namespace in c# program

In C#, namespaces are used to arrange a large number of classes so that the program can be easily managed. System is used in a basic C# program. Console is a class that belongs to the System namespace. We must use namespace name to get the class of a namespace.

Namespace is a C++ feature that is not available in C. A namespace is a declarative zone that gives identifiers for types, functions, variables, and other objects inside it a scope. It is permissible to have many namespace blocks with the same name. The named scope is used for all declarations within those blocks.

Similar Programs