w3resource
C# Sharp Programming Exercises

C# Sharp Exercises: Display three letters in reverse order


C# Sharp Basic Data Types: Exercise-1 with Solution

Write a C# Sharp program that takes three letters as input and display them in reverse order.

Sample Solution:-

C# Sharp Code:

using System;
public class Exercise1
{
  public static void Main()
  {  
    char letter,letter1,letter2;
  
    Console.Write("Input letter: ");
    letter = Convert.ToChar(Console.ReadLine());
 
    Console.Write("Input letter: ");
    letter1 = Convert.ToChar(Console.ReadLine());       
 
    Console.Write("Input letter: ");
    letter2 = Convert.ToChar(Console.ReadLine());
     
    Console.WriteLine("{0} {1} {2}",letter2,letter1,letter);
   }
}

Sample Output:

Input letter: a                                                                                               
Input letter: b                                                                                               
Input letter: c                                                                                               
c b a

Flowchart:

Flowchart: Display three letters in reverse order

C# Sharp Code Editor:

Contribute your code and comments through Disqus.

Previous: C# Sharp Data Types Exercises
Next: Write a C# Sharp program that takes three letters as input and display them in reverse order.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming