Advertisement
Guest User

Untitled

a guest
Aug 9th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main()
  6.     {
  7.         string name = Console.ReadLine();
  8.  
  9.         Console.Write("Your name according to ASCII: ");
  10.         foreach (char ch in name)
  11.         {
  12.             Console.Write((int)ch);
  13.         }
  14.  
  15.         Console.WriteLine();
  16.         foreach (char ch in name)
  17.         {
  18.             Console.WriteLine("Char {0} is {1} according to ASCII", ch, (int)ch);
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement