star pattern 3 by using 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