img
Question:
Published on: 21 November, 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