0 votes
139 views
in C program by (98.9k points)
edited
In the below pattern columns are started from 1 to N, and the number of columns is equal to the number of rows.

Enter number of rows: 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5

1 Answer

0 votes
by (98.9k points)
selected by
 
Best answer
#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("%d",j);
     }
     printf("\n");
   }

   return 0;
}

 

Related questions

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

535 users

...