Q:

Write a C# program that takes a number as input and then displays a rectangle of 3 columns wide and 5 rows tall using that digit

0

Write a C# program that takes a number as input and then displays a rectangle of 3 columns wide and 5 rows tall using that digit

Sample Output:

Enter a number: 5                                                                                             
555  
5 5 
5 5
5 5 
555

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using System;
public class Exercise13
{
    public static void Main()
    {
        int x;
         
        Console.Write("Enter a number: ");
        x=Convert.ToInt32(Console.ReadLine());
     
        Console.WriteLine("{0}{0}{0}",x);
        Console.WriteLine("{0} {0}",x);
        Console.WriteLine("{0} {0}",x);
        Console.WriteLine("{0} {0}",x);
        Console.WriteLine("{0}{0}{0}",x);
    }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now