Advertisement
dimipan80

2. Printing_ASCII_Table_Symbols

Jun 1st, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 KB | None | 0 0
  1. /* Find online more information about ASCII (American Standard Code for Information Interchange)
  2.  * and write a program to prints the entire ASCII table of characters at the console
  3.  * (characters from 0 to 255). Note that some characters have a special purpose
  4.  * and will not be displayed as expected. You may skip them or display them differently.
  5.  * You may need to use for-loops (learn in Internet how). */
  6.  
  7. namespace _14.PrintTheASCIITable
  8. {
  9.     using System;
  10.     using System.Text;
  11.  
  12.     public class PrintTheASCIITable
  13.     {
  14.         public static void Main(string[] args)
  15.         {
  16.             Console.OutputEncoding = Encoding.Unicode;
  17.             checked
  18.             {
  19.                 Console.WriteLine("The entire ASCII Table of characters from 0 to 255 is:");
  20.                 Console.WriteLine();
  21.                 for (int i = 0; i <= 255; i++)
  22.                 {
  23.                     char symbol = (char)i;                  
  24.  
  25.                     Console.WriteLine("ASCII Symbol {0,3} --> {1,2}", i, symbol);
  26.                 }
  27.  
  28.                 Console.WriteLine();                
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement