Advertisement
AnitaN

02.PrimitiveDataTypesVariables/14.PrintASCIITable

Mar 11th, 2014
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. //Problem 14.   * Print the ASCII Table
  2. //Find online more information about ASCII (American Standard Code for Information Interchange) and write a program to prints the entire ASCII table of characters at the console (characters from 0 to 255). Note that some characters have a special purpose and will not be displayed as expected. You may skip them or display them differently. You may need to use for-loops (learn in Internet how).
  3.  
  4. using System;
  5. using System.Text;
  6.  
  7. class PrintASCIItable
  8. {
  9.     static void Main()
  10.     {
  11.         Console.OutputEncoding = Encoding.Unicode;
  12.         for (int i = 0; i <= 255; i++)
  13.         {
  14.             char symbol = (char)i;
  15.             Console.WriteLine("ASCII symbol {0} and number {1}", symbol, i);
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement