Interview

Reading and writing to a console C#


In this video, we will discuss
1. Reading from the console
2. Writing to the console
3. Two ways to write to console
a) Concatenation
b) Place holder syntax – Most preferred

Code samples used in the demo
using System;
class Program
{
    static void Main()
    {
        // Prompt the user for his name
        Console.WriteLine(“Please enter your name”);
        // Read the name from console
        string UserName = Console.ReadLine();
        // Concatenate name with hello word and print
        Console.WriteLine(“Hello ” + UserName);

        //Placeholder syntax to print name with hello word 
        //Console.WriteLine(“Hello {0}”, UserName);
    }
}

Please note that C# is case sensitive language.

About the author

shohal

I have profession and personal attachment with custom ERP Software development, Business Analysis, Project Management and Implementation almost (36) ,also Oracle Apex is my all-time favorite platform to developed the software. Moreover i have some website development experience with WordPress. For hand on networking experience DevOps and CCNA, it create me a full package. Here are some core programming language with networking course i have been worked: Oracle SQL ,PL/SQL,Oracle 19c Database , Oracle Apex 20.1,WordPress,Asp.Net ,MS SQL ,CCNA ,Dev Ops, SAP SD

Leave a Comment