Friday, 19 November 2010

c program for print the *'s in the following format

*
**
***

#include<stdio.h>
void main()
{
 int i,j,k;
 i=0;
 printf("enter no of rows\n");
 scanf("%d", &i);
 for(j=0;j<i;j++)
 {
   printf("\n");
   for(k=0;k<=j;k++)
    printf("*");
 }

No comments:

Post a Comment