ad

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


No comments:

Post a Comment