By using our mini forum, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy

Q: How to print the ASCII Table in C#?

+3 votes

I need to write a program which prints the entire ASCII table - of characters at the console (characters from 0 to 255). I may need to use for-loops?

asked in C# category by user andrew
edited by user golearnweb

1 Answer

+1 vote

thry this code mate:

using System;

class asciiTable
    static void Main()
        Console.OutputEncoding = System.Text.Encoding.UTF8;
        for (int i = 0; i < 255; i++)
            char symbol = (char)i;
            Console.WriteLine("{0} -> {1}", i, symbol);
answered by user hues
edited by user golearnweb
Or without this line: Console.OutputEncoding = System.Text.Encoding.UTF8;