Welcome to my blog this is test

28 June 2012

write a C program to print the Floyd’s triangle


//Code:
#include
#include
 void main()
  {
   int i,j,n;
   clrscr();
   printf("\n Enter the no of row : ");
    scanf("%d",&n);
     for(i=1;i<=n;i++)
       {
          for(j=1;j<=i;j++)
          printf("*");
          printf("\n");
       }
    getch();
  }

/*Output:
Enter the no of row : 5
*
**
***
****
*****

No comments:

Post a Comment