Skip to content
Snippets Groups Projects
N.c 476 B
/*M Letter pattern
*       *
**      *
* *     *
*  *    *
*   *   *
*    *  * 
*     * * 
*      **
*       * */
#include <stdio.h>
int main(){
    int n;
    printf("Enter the limit (prefer odd number):"); 
    scanf("%d", &n);
    for(int i=1; i<=n; i++){
        for(int j=1; j<=n; j++){
            if((j==1&&i<=n)||(j==n&&i<=n)||(i==j)){
                printf("*");
            } else{
                printf(" ");
            }
        }
        printf("\n");
    }
}