Computer Science, asked by viraj123, 7 months ago

Write a program to generate this pattern for n lines:
# # ##
# # # #
# # # #
# # # #

Answers

Answered by shivaramcvm
1

int main() { int row, c, n;

printf("Enter the number of rows in pyramid of stars to print\n"); scanf("%d", &n);

for (row = 1; row <= n; row++) // Loop to print rows. { ...

for (c = 1; c <= 2*row - 1; c++) // Loop to print stars in a row. printf("*");

printf("\n"); }

Answered by anindyaadhikari13
3

Question:-

Write a program to display the pattern.

####

####

####

####

Program:-

Here is your program written in Python.

n=int(input("Enter the number of rows for the pattern.."))

for i in range(0,n):

for j in range(0,n):

print("# ",end="")

print()

Similar questions