In the below pattern each column contains N number of stars where N is the number of rows. The number of rows and columns are the same so we can assume it as a square matrix.
Enter the number of rows: 5 * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * *
Please read the guide .
Please answer the question in detail
Code :
#include<stdio.h> int main() { int n,i,j; printf("Enter the number of rows: "); scanf("%d",&n); for(i=1; i<=n; i++) { for(j=1; j<=n; j++) { printf("* "); } printf("\n"); } return 0; }
Doubtly is an online community for engineering students, offering:
Get the pro version for free by logging in!
5.7k questions
5.1k answers
108 comments
554 users