Write a simple application that accept 5 names from a user, and prints the names out in the reverse order. example Ben,Amavi,Peace,Amoo,Nester. Should be printed out as Nester,Amoo,Peace,Amavi and Ben.(Note use function to implement this program)
1
Expert's answer
2015-12-02T07:58:52-0500
using System;
namespace ReverseNamesOrder { class Program { static void Main(string[] args) { string[] names = new string[5];
// Read names Console.WriteLine("Enter five names, please. One by line."); for (int i = 0; i < 5; i++) { names[i] = Console.ReadLine(); }
// Write reverse order Console.WriteLine(); Console.WriteLine("Reverse order: "); for (int i = 4; i >=0; i--) { Console.WriteLine(names[i]); }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment