star pattern 1 by for loop
#include<stdio.h>
#include<conio.h>
main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if (j<=i)
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
output
*
**
***
****
*****
Comments
Post a Comment