Computer Science, asked by daivapriyan1825, 9 months ago

Write a program that reads in a number n and prints out n rows each containing n star characters, '*'.
Thus if n is 3, then your program should print

Answers

Answered by AmanGangwar
0
The following code is in python -
n=int(input(“Enter the number - “))
for i in range(n+1):
for j in range(n+1):
print(“*”, end=‘ ‘)
Answered by qwsuccess
1

The program that reads in a number n and prints out n rows, each containing n '*' characters is as follows:

  • def pattern (n):
  •    for i in range (n):
  •        for j in range (n):
  •            print('*',end='')
  •        print()

  • The above lines of code will help u print the desired pattern.
  • The pattern can be viewed by callin the function pattern(n) that has been defined.
  • n is the parameter of the function pattern and needs to be an integer value.
Similar questions