#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
printf("Enter the number of row::\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=0;j<i;j++)
{
printf("*");
}
printf("\n");
}
getch();
}
Output:
Enter the number of row::4
*
* *
* * *
* * * *
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
printf("Enter the number of row::\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=0;j<i;j++)
{
printf("*");
}
printf("\n");
}
getch();
}
Output:
Enter the number of row::4
*
* *
* * *
* * * *
No comments:
Post a Comment