Thursday 3 October 2013

Printing '*' pattern1 using C

#include <stdio.h>
 main()
{
    int n, c, k;
    printf("\n(There is) none worthy of worship except Allah(Subhanahu wa ta'ala).Muhammad(Sallallahu alayhi wasallam) is Messenger of ALLAH(Subhanahu wa ta'ala).\n");
  printf("Enter number of rows\n");
    scanf("%d",&n);
    for ( c = 1 ; c <= n ; c++ )
    {
        for( k = 1 ; k <= c ; k++ )
            printf("*");
        printf("\n");
    }
}

No comments:

Post a Comment