C# (C Sharp) Console and Input Program

Well, I’ve started a network development class at UVU (UVSC) and I have to quickly learn C Sharp to be able to get my assignments and labs done. Here is my version of the first lab (which is a simple hello world style lab)

 1 using System;
 2 using System.Collections.Generic;
 3 using System.Text;
 4 
 5 namespace Names
 6 {
 7     class Program
 8     {
 9         static void Main(string[] args)
10         {
11             String firstName;
12             String lastName;
13             String fullName;
14 
15             System.Console.Write("Please enter your first name: ");
16             firstName = System.Console.ReadLine();
17 
18             System.Console.Write("Please enter your last name: ");
19             lastName = System.Console.ReadLine();
20 
21             fullName = firstName + " " + lastName;
22             System.Console.WriteLine("your name (first last) is: " + fullName);
23 
24             fullName = lastName + ", " + firstName;
25             System.Console.WriteLine("your name (last, first) is: " + fullName);
26 
27             System.Console.ReadLine();
28         }
29     }
30 }

One Response to “C# (C Sharp) Console and Input Program”

  1. Both the Atari 2600 and Intellivison experienced compilations created for more
    modern consoles. I never really cared for that II’s but
    I have observed copies in the incompatible games which
    do work on them. if your version from the game came in the blue box,
    you have got the good updated version.

Leave a Reply


Switch to our mobile site