Preview:
#include<stdio.h>
#include<cs50.h>

int main(void){
    do{
         const int n = get_int("Size: ");
    }
    while(n<1);

    for(int i=0;i<n;i++){
        for(int j=0;j<2*(n-1);j++){
            printf("#");
        }
        printf("\n");
    }
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter