0 votes
115 views
in C program by (98.9k points)
edited

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
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *

1 Answer

0 votes
by (98.9k points)
selected by
 
Best answer

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;
}

 

Related questions

0 votes
1 answer 122 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

558 users

...