ad

Sunday, May 25, 2025

C program to Print Alphabet N star pattern

 C program to Print  Alphabet  N star pattern 


C program to Print  Alphabet  N star pattern


C program to Print  Alphabet  N star pattern 
Example 


#include <stdio.h>

int main()
{
    int a,b;
    int n = 7; // height of the N (can be adjusted)

    for (a = 0; a < n; a++)
{
        for (b = 0; b < n; b++)
{
            // Print * for the first column, last column, and diagonal
            if (b == 0 || b == n - 1 || b == a)
                printf("*");
            else
                printf(" ");
        }
        printf("\n");
    }

    return 0;
}


C program to Print  Alphabet  N star pattern 
Output

C program to Print  Alphabet  N star pattern

Related Post :-


C program to print alphabet k star Pattern

C program to prin alphabet j star Pattern

No comments:

Post a Comment