Monday 17 October 2011

Printing of Isosceles Triangle of Star

//prints isosceles triangle of star//
#include<stdio.h>
#include<conio.h>
main()
{
      int row, clm, space;
      for(row = 1; row <= 20; row+=2)
      {
               
              //printing spaces//
              for(space=18; space >= row; space-=2)
                      {
                              printf("%c",' ');
                      }
              //printing stars//
              for(clm = 1; clm <=(row); clm++ )
              {
              printf("*");
              }
       printf("\n");
      }
getche();
return 0;
}


No comments:

Post a Comment