img
Question:
Published on: 21 December, 2024

Write a C program to print pattern below:

*

* *

* * *

* * * *
Answer:

 

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


Output:

Random questions