Programming Course in C# ¡Free!

char

 Saturday, April 06, 2013 published by Exercises C#
Proposed exercise

Write a program to ask the user for three letters and display them in reverse order.


Output



Solution


using System;
public class Char 
{
public static void Main()
{  
char letter,letter2,letter3;

Console.Write("Enter letter: ");
letter = Convert.ToChar(Console.ReadLine());

Console.Write("Enter letter: ");
letter2 = Convert.ToChar(Console.ReadLine());       

Console.Write("Enter letter: ");
letter3 = Convert.ToChar(Console.ReadLine());

Console.WriteLine("{0} {1} {2}",letter3,letter2,letter);
}
}