Pages

Sunday, 28 January 2018

Printing of Isosceles Triangle of Star

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;
}