Code:#include<stdio.h>
main()
{
int i,j;
for(i=1;i<=4;i++)
{
for(j=1;j<=4-i;j++)
{
printf(" ");
}
for(j=1;j<=2*i-1;j++)
{
printf("*");
}
printf("\n");
}
Printable View
Code:#include<stdio.h>
main()
{
int i,j;
for(i=1;i<=4;i++)
{
for(j=1;j<=4-i;j++)
{
printf(" ");
}
for(j=1;j<=2*i-1;j++)
{
printf("*");
}
printf("\n");
}
Have you tried running it?
Perhaps go though and rename the lousy variable names with something better, say
for ( rowNumber = 1;rowNumber <=4;rowNumber ++)