* Problem: A Square Made Out of Stars

Write a C# console program that reads from the console an integer N and prints on the console a square made out of N stars, like in the examples below.

Sample Input and Output

Input Outup Input Output Input Output
3 ***
* *
***
4 ****
*  *
*  *
****
5 *****
*   *
*   *
*   *
*****

Tips and Tricks

Create a new console C# program. To read the number N (2 ≤ N ≤100), use the following code:

Finish the program above, so that it prints a square, made out of stars. It might be necessary to use for loops. Look for information on the Internet.

Attention: this task is harder than the rest and is given now on purpose, and it's marked with a star, in order to provoke you to look for information on the Internet. This is one of the most important skills that you have to develop while you're learning programming: looking for information on the Internet. This is what you're going to do every day, if you work as a developer, so don't be scared, try it out. If you have any difficulties you can also ask for help in the SoftUni forum: https://softuni.bg/forum.

Testing in the Judge System

Test your solution here: https://judge.softuni.bg/Contests/Practice/Index/503#5.

results matching ""

    No results matching ""