Advertisement
Guest User

Untitled

a guest
Feb 16th, 2019
1,130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System;
  2.  
  3. namespace CharactersInRange
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             char inputOne = char.Parse(Console.ReadLine());
  10.             char inputTwo = char.Parse(Console.ReadLine());
  11.  
  12.             PrintTheCharsBetweenTwoChars(inputOne, inputTwo);
  13.         }
  14.  
  15.         private static void PrintTheCharsBetweenTwoChars(char one, char two)
  16.         {
  17.             int nextChar = one + 1;
  18.             for (char i = Convert.ToChar(nextChar); i < two; i++)
  19.             {
  20.                 Console.Write(i + " ");
  21.             }
  22.             Console.WriteLine();
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement