Create an application that produces three different outputs using the same phrase. Select your own favorite popular saying for the phrase. The phrase should first be displayed on one line. Use at least three Write( ) methods - but the output should all appear on a single line.
Then print the phrase on three lines, again using only Write( ) methods. For your third and final output, print your favorite saying one word per line. Decide which combination of Write( ) and/or WriteLine( ) would be the most streamlined approach. Following is an example of what the final output would look like using a favorite saying of the author:
Program:
using System;
namespace ProgrammingExercise6
{
class Program
{
static void Main(string[] args)
{
// First dispaly output
Console.Write("Output #1");
Console.Write("\nLaugh often. ");
Console.Write("Dream big. ");
Console.Write("Reach for the start! \n");
// Second dispaly output
Console.Write("\nOutput #2");
Console.Write("\nLaugh often. \n");
Console.Write("Dream big. \n");
Console.Write("Reach for the start! \n");
// Third dispaly output
Console.Write("\nOutput #3");
Console.WriteLine("\nLaugh");
Console.WriteLine("often.");
Console.WriteLine("Dream");
Console.WriteLine("big.");
Console.WriteLine("Reach");
Console.WriteLine("for");
Console.WriteLine("the");
Console.WriteLine("start!");
Console.ReadKey();
}
}
}
Output:
Explanation:
* For Write method we have to use aruguments to split the string.
* For WriteLine method there is no need of using aruguments,spaces in between the string.