Skip to content
Snippets Groups Projects
ltriangle.c 450 B
/*Left-triangle  pattern
        *
       **
      * *
     *  *
    *   *
   *    *
  *     *
 *      *
********* */
#include <stdio.h>
int main(){
    int n;
    printf("Enter the limit: ");
    scanf("%d", &n);
    for(int i=1; i<=n; i++){
        for(int j=n; j>=1; j--){
            if((i==j)||(i==n&&j<=n)||(j==1)){
            printf("*");
            } else{
                printf(" ");
            }
        }
        printf("\n");
    }
}