Pages

Sunday, 28 January 2018

Printing Right Angel Triangel of Stars (Right angel at upper right corner)


Printing Right Angel Triangel of Stars (Right angel at upper right corner)
//prints triangle of star with right angle at upper right corner//
#include<stdio.h>
#include<conio.h>
main()
{
      int row, clm,space;
      for(row = 1; row <= 10; row++)
      {
              //printing spaces//
              for(space=2; space <= row; space++)
              {
                      printf("%c",' ');
              }
                      
              //printing Stars//
              for(clm = 9; clm >=row; clm--)
              {
                      printf("%c",'*');
              }
              printf("\n");
      }
getche();
return 0;

}