design part 4

            *
          **
        ***
      ****
    *****

To create this----

#include<conio.h>
void main()
{int n,i,j;
printf("enter a number ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{for(j=1;j<=n-i;j++)
{printf(" ");
}
for(;j<=n;j++)
{printf("*");
}
printf("\n");
}
getch();
return;
}

try out this..................

Post a Comment

0 Comments