Thursday, November 22, 2012

C PROGRAM FOR FLOYD’S TRIANGLE


 /* C PROGRAM FOR  FLOYD’S TRIANGLE */


#include<stdio.h>
#include<conio.h>

void main()
{
    int i,j,rows;
    clrscr();
    printf("\n\t\tFLOYD'S TRIANGLE");
    printf("\n\t\t~~~~~~~~~~~~~~~~");
    printf("\nEnter the rows:");
    scanf("%d",&rows);
    for(i=1;i<=rows;i++)
   {
     for(j=1;j<=i;j++)
     {
      printf("*");
    }
     printf("\n");
   }
  getch();
}
















OUTPUT:

                FLOYD'S TRIANGLE
               

Enter the rows: 5
*
**
***
****
*****


0 comments:

Post a Comment