/*Print pattern using nested for loop
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
4 4 4 4 4
5 5 5 5 5
*/
#include<stdio.h>
int main()
{
int i,j,n;
printf("Enter size of the square : \n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=n;j>=1;j--)
printf("%d ",i);
printf("\n");
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: