How to print * and 1-4 pattern simultaneously ?

CODE




How to print * and 1-4 pattern simultaneously ?
int main()
{
    int i,j,k;
    for(i=4;i>=1;i--)
    {
        for(j=1;j<=i-1;j++)
        {
            printf("*");
        }
        for(k=1;k<=4-i+1;k++)
        {
            printf("%d",k);
        }
        printf("\n");
    }
}

Output:
***1
**12
*123
1234

How to print * and 1-4 pattern simultaneously ? How to print * and 1-4 pattern simultaneously ? Reviewed by Unknown on December 16, 2018 Rating: 5

No comments:

If you have any doubt or query ,comment below:

Programming copyright © 2018-19. Powered by Blogger.