Answer to Question #132445 in C# for Dennis

Question #132445
Using nested loops, write a C# application program that produces the following output.
& & & & & &
* & * * * *
* * & * * *
* * * & * *
* * * * & *
& & & & & &
1
Expert's answer
2020-09-10T08:26:57-0400
using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Simbols();
        }


        static void Simbols()
        {
            for (int i = 0; i < 7; i++)
            {
                for (int j = 0; j < 7; j++)
                {
                    if (i == 0 || i == 6)
                    {
                        Console.Write("&");
                    }
                    else if (i == j)
                    {
                        Console.Write("&");
                    }
                    else
                    {
                        Console.Write("*");
                    }
                }
                Console.WriteLine();
            }
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS