* ** *** **** *****
#include <stdio.h>
int main()
{
int i, j;
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("*");
}
printf("\n");
}
return 0;
}
Related Links:
- More Number Pattern Programs
- Star Pattern Programs in C
- Alphabet Pattern Programs in C
- Series Programs in C
Thanxxxxx
ReplyDeletethis is wrong and it will crash ur program
ReplyDeletethe code is:
for(i=0;i=n-i;j--)
{
printf("*");
}
}
Seriously ??? :)
DeleteNo its right.... Code should be perfect
DeleteHey thanks for the code, but can u just explain the logic or execution of the loops? pls! :)
ReplyDeletem confused!
ReplyDelete#include
int main()
{
int n;
printf("How many rows");
scanf("%d",&n);
for(int i=0; i<n; ++i)
{
for(int j=0; j<n; ++j)
{
printf(" ");
}
for(int k=0; k<=i; ++k)
{
printf("* ");
}
for(int l=0; l<n; ++l)
{
printf("\n");
}
}
}
wrong
ReplyDeleteexplain logic
ReplyDeleteThanx its really smpl ...:*
ReplyDeleteint i, j;
ReplyDeletefor(i=1;i<=5;i )
{
for(j=1;j<=i;j )
{
printf("*");
}
printf("\n");
}
In need this programe using only 1 for loop
ReplyDeletenice concept and try
ReplyDeletenice thanku
ReplyDeleteProgram is wrong
ReplyDeleteFor (I=0;I<5;I++)
For(j=0;j<=I;j++)
This is right