ad

Sunday, May 25, 2025

C program to Print Alphabet O star pattern

 

 C program to Print  Alphabet  O star pattern 

C program to Print  Alphabet  O star pattern


C program to Print  Alphabet  O star pattern 
Example 


#include <stdio.h>

int main()
{
    int a, b;
    int n = 7; // height and width of the O

    for (a = 0; a < n; a++)
{
        for (b = 0; b < n; b++)
{
            // Print * for the boundary of O
            if ((a == 0 || a == n-1) && (b > 0 && b < n-1)
|| (b == 0 || b == n-1) && (a > 0 && a < n-1))
                printf("*");
            else
                printf(" ");
       
}

        printf("\n");

    }

    return 0;
}


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

Friday, May 23, 2025

C program to Print Alphabet L star pattern

                                            C program

C program to Print  Alphabet  L star pattern


C program to Print  Alphabet  L star pattern 
Example 


#include <stdio.h>

int main() {
    int a,b;
    int n = 7; // height of the L

    for (a = 0; a < n; a++)
{
        for (b = 0; b < n; b++)
{
            // Print * for the left vertical line and the bottom horizontal line
            if (b == 0 || (a == n - 1 && b < n))
{
                printf("*");
            } else {
                printf(" ");
            }
        }
        printf("\n");
    }

    return 0;
}


C program to Print  Alphabet  L star pattern 
Output


C program to Print  Alphabet  L star pattern




Related Post :-

c program to print hollow square star

Thursday, May 22, 2025

C program to Print Alphabet K star pattern

                                                C program

C program to Print  Alphabet  k star pattern

C program to Print  Alphabet  J star pattern 
Example 

#include <stdio.h>

int main()
{
    int a, b;
    int height = 7;
// Height of the K

    for(a = 0; a < height;a++)
{
        printf("*");
// First vertical line

        for(b = 0; b < height;b++) {
            if (a + b == height / 2 || a - b == height / 2)
{
                printf("*");
            } else {
                printf(" ");
            }
        }
        printf("\n");
    }

    return 0;
}
 


C program to Print  Alphabet  K star pattern 
Output


Related Post :-

C program to print alphabet G star