img
Question:
Published on: 22 December, 2024

Write a C program to print the following output.

1 

2   2

3   3   3

4   4   4   4

5   5   5    5   5
Answer:
#include<stdio.h>
#include<conio.h>
main()
{
	int n,i,j;
	printf("\n enter hou meny lines");
	scanf("%d",&n);
	for(i=0;i<=n;i++)
	{
		for(j=0;j<i;j++)
		{
			printf("\t%d",i);
		}
		printf("\n");
	}
	getch();
}


Output:

Random questions