ad

Sunday, April 27, 2025

C program to Print Alphabet J star pattern

 C program

C program to Print  Alphabet  J star pattern
C program to Print  Alphabet  J star pattern 
Example 


#include <stdio.h>

int main()
{
    int a, b;
    int n = 7;
// Height of the J pattern

    for (a = 0; a < n; a++)
{
        for (b = 0; b < n; b++)
{
            // Print the vertical part of J
           
if (b == n / 2 && a != 0 ||
                (a == n - 1 && b <= n / 2) ||
                (a == n - 2 && b == 0))
                printf("*");
            else
                printf(" ");
        }
        printf("\n");
    }

    return 0;
}



C program to Print  Alphabet  J star pattern 
Output

C program to Print  Alphabet  J star pattern

Related Post :-


C program to print alphabet G star

No comments:

Post a Comment