5. Write a program to print pattern like :
Attachments:
Answers
Answered by
0
#include
int main()
{
int rows, cols, i, j;
/* Input rows and columns from user */
printf("Enter number of rows: ");
scanf("%d", &rows);
printf("Enter number of columns: ");
scanf("%d", &cols);
for(i=1; i<=rows; i++)
{
for(j=1; j<=cols; j++)
{
// Print the current row number
printf("%d", i);
}
printf("\n");
}
return 0;
}
Similar questions
Chemistry,
2 days ago
Math,
5 days ago
Science,
5 days ago
Business Studies,
9 months ago
Math,
9 months ago