A Revolution
From the Norm,
Towards Greatness
Home » » CSharp (C#): Write a Console Message & Text Input

CSharp (C#): Write a Console Message & Text Input

Written By Unknown on Wednesday, June 15, 2016 | 6:27 PM

CSharp (C#): Write a Console Message & Text Input

Welcome programmers from all around the world, on today's tutorial (which is a little late since this is episode #5).... We will be learning how to write a message on CSharp (C#) console system and also offer the user an option to insert a text in the form of an input/output style. 

The reason this tutorial is a little late, is because it should have gone hand in hand with my first C# tutorial of "Hello World." Other than that, you can get started with my YouTube tutorial to get a good and warm welcoming on how to do this. 



This is a two part tutorial, so I shall be offering two types of sources codes for each.. Instead of both on one. 

How to write a line, 
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Coder_Revolt___CSharp_Intro_to_Console
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Console.WriteLine("Hello World, I'm Coder Revolt");
  13.             Console.ReadLine();
  14.         }
  15.     }
  16. }

How to offer an input and get an output,
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Coder_Revolt___CSharp_Intro_to_Console
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Console.Write("What is your age? :");
  13.             Console.Write("Your age is: {0}", Console.ReadLine());
  14.             Console.ReadLine();
  15.         }
  16.     }
  17. }

SHARE

About Unknown

0 comments :

Post a Comment