Sunday, April 27, 2025

C Program to Print Alphabet J Star Pattern with Example

 C program pattern 

C Program to Print Alphabet J Star Pattern with Example


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 with Example
Explain Program

Step :1

Header File

#include <stdio.h>

  •  Standard I/O library to use the printf function for output.

Saturday, April 26, 2025

C Program to Print Alphabet H Star Pattern with Example

 C program pattern 

c program to display alphabet pattern H with asterisk



C program to Print  Alphabet  H star pattern 
Example:-


#include <stdio.h>

int main()
{
    int a, b;
    int n = 7;
    for (a = 0; a < n; a++)
{
        for (b = 0; b < n;b++)
{
            if (b == 0 || b == n - 1 || a == n / 2)
                printf("*");
            else
                printf(" ");
        }
        printf("\n");
    }

    return 0;
}


C Program to Print Alphabet H Star Pattern with Example
Explain Program

Step :1

#include <stdio.h>

  • standard input-output library use functions like printf().

Friday, April 25, 2025

c program to display alphabet pattern G with asterisk

C Program pattern

C Program to Print Alphabet G Star Pattern with Example


C program to Print  Alphabet  G star pattern 
Example :-


#include <stdio.h>

int main() {
    int a, b;
    int n = 7;

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

    return 0;
}


C Program to Print Alphabet G Star Pattern with Example
Explain Program

Step :1

#include <stdio.h>

Includes the standard input-output library to use functions like printf().

Thursday, April 24, 2025

c program to display alphabet pattern F with asterisk

 C Program

c program to display alphabet pattern F with asterisk


C program to Print  Alphabet  F star pattern 
Example :-



#include <stdio.h>


int main() {
    int a, b;
    int rows = 7;  

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

    return 0;
}



c program to display alphabet pattern F with asterisk
Explain Program

Step :1

#include <stdio.h>

Includes the standard input-output library to use functions like printf().

int main() { ... }

.The entry point of the program.

Wednesday, April 23, 2025

c program to display alphabet pattern I with asterisk

C program 

c program to display alphabet pattern I with asterisk



C program to Print  Alphabet  I star pattern 

Example 



#include <stdio.h>

int main() {
    int a, b;
    int n = 7;  
    // print of the I

    for (a = 0; a < n; a++) {
        for (b = 0; b < n; b++) {
           
            // Print * for the top, middle, and bottom rows
           
            // or the vertical column in the middle
           
            if (b == n / 2 || a == 0 || a == n - 1) {
                printf("*");
            }
            else
            {
                printf(" ");
            }
        }
        printf("\n");
    }

    return 0;
}


c program to display alphabet pattern I with asterisk
Explain Program

Step :1

#include <stdio.h>

standard input/output library for function printf() and scanf()

c program to display alphabet pattern E with asterisk

  C program

c program to display alphabet pattern E with asterisk



C program to Print  Alphabet E star pattern 
Example


#include <stdio.h>

int main() {
    int a,b;
    int height = 7;
    int width = 5;  

    for (a = 0; a < height;a++) {
        for (b = 0; b < width; b++) {
           
            if (b == 0 || (a == 0 || a == height / 2 || a == height - 1))

          printf("*");

        else

          printf(" ");

        }

        printf("\n");
   
}

    return 0;

}


c program to display alphabet pattern E with asterisk
Explain Program

Step :1

#include <stdio.h>

standard input/output library for function printf() and scanf()

Tuesday, April 22, 2025

C Program to Print Alphabet D Star Pattern with Example

C Program

C Program to Print Alphabet D Star Pattern with Example


C program to Print  Alphabet D star pattern 

Example

#include <stdio.h>

int main() {
    int i, j;
    int n = 7;

    for (i = 0; i < n; i++) {
        for (j = 0; j < n; j++) {
           
            if (j == 0 ||
                (i == 0 && j < n - 1) ||
                (i == n - 1 && j < n - 1) ||
                (j == n - 1 && i != 0 && i != n - 1))
                printf("*");
            else
                printf(" ");
        }
        printf("\n");
    }
 
    return 0;
}


C Program to Print Alphabet D Star Pattern with Example
Explain Program

Step :1

#include <stdio.h>

standard input/output library for function printf() and scanf()

C Program to Print Alphabet C Star Pattern with Example

C Program

C Program to Print Alphabet C Star Pattern with Example


 C program to Print  Alphabet C star pattern 
Example


#include <stdio.h>

int main()
{
    int a, b;
    int rows = 7;


    for (a = 0; a < rows; a++)
{
        for (b = 0; b < rows;b++)
{
         
            if (a == 0 || a == rows - 1 || b == 0)
{
             
                if ((a == 0 || a == rows - 1) && b > 4)
                    continue;
                printf("*");
           
} else {

                printf(" ");
            }
        }

        printf("\n");
    }

    return 0;

}


C Program to Print Alphabet C Star Pattern with Example
Explain Program

Step :1

#include <stdio.h>

 standard input-output library in C, so you can use printf().

Monday, April 21, 2025

C Program to Print Alphabet B Star Pattern with Example

                                              C Program



C program to Print B star pattern Asterisks pattern 

 Example:-


#include <stdio.h>

int main() {
    int a, b;
    int rows = 7;  

    for (a= 0; a < rows; a++) {
        for (b= 0; b < 5; b++) {
           
            if (b == 0 ||
                (a == 0 && b < 4) ||
                (a == rows / 2 && b < 4) ||
                (a == rows - 1 && b < 4) ||
                (b == 4 && a!= 0 && a != rows / 2 && a != rows - 1)) {
                printf("*");
            } else {
                printf(" ");
            }
        }
        printf("\n");
    }

    return 0;
}


This C Program Print a pattern in the shape of the capital letter B using asterisks "*"
Explain Program

Step :1

#include <stdio.h>

 standard input/output library for using functions like printf().

Tuesday, April 15, 2025

C Program to Print Alphabet A Star Pattern with Asterisks

C Program to Print Alphabet A Star Pattern with Asterisks


C program to Print A star pattern Asterisks pattern 

Example:-


#include <stdio.h>

int main() {
    int no = 7;
    int i, j;
    for (i = 0; i < no; i++)
{
        for (j = 0; j <= no; j++)
{
              if ((j == 0 || j == no) && i != 0 || (i == 0 && j > 0 && j < no) ||
(i == no / 2))
                printf("*");
            else
                printf(" ");
        }
        printf("\n");
    }
     return 0;
    }



This C Program Print a pattern in the shape of the capital letter A  using asterisks "*"
Explain Program

Step :1

#include <stdio.h>

  • standard input-output library.
  • Required for using printf().

Monday, April 14, 2025

C Program to print Hollow Hourglass pattern

   C  Program Hollow Hourglass pattern  

C Program to print Hollow Hourglass pattern


C Program to print Hollow Hourglass pattern 
Example :-


#include <stdio.h>
 
int main()
{
  int i, j, k, rows;
 
  printf("Enter the no. of rows: ");
  scanf("%d", &rows);
 
  printf("Output: \n\n");
 
  for (i = 1; i <= rows; i++)
  {
    for (k = 1; k < i; k++)
      printf(" ");
 
    for (j = i; j <= rows; j++)
      printf("* ");
 
    printf("\n");
  }
 
  for (i = rows - 1; i >= 1; i--)
  {
    for (k = 1; k < i; k++)
      printf(" ");
 
    for (j = i; j <= rows; j++)
      printf("* ");
 
    printf("\n");
  }
 
  return 0;
}


C Code for Printing a Hollow Hourglass Shape

Explain Program

Step :1

Variable Declarations:

int i, j, k, rows;

  • i, j, k: Loop control variables
  • rows: Number of rows (input from the user)

C Program to Display a Hollow Diamond Shape with Star

C Program  Pattern

C Program to Display a Hollow Diamond Shape with Star


C Program to print Hollow Diamond Star Pattern
Example :-


#include <stdio.h>
#include <stdlib.h>
int main()
{
int i,j,rows;
printf("Enter the number \n");
scanf("%d",&rows);


for(i=1; i<=rows; i++){
for(j=rows; j>i; j--){
printf(" ");
}


printf("*");
for(j=1; j<(i-1)*2; j++){
printf(" ");
}


if(i==1){
printf("\n");
}


else{
printf("*\n");
}
}

for(i=rows-1; i>=1; i--){
for(j=rows; j>i; j--){
printf(" ");
}


printf("*");
for(j=1; j<(i-1)*2; j++){
printf(" ");
}


if(i==1){
printf("\n");
}


else{
printf("*\n");
}
}
return 0;
}



C Program to Display a Hollow Diamond Shape with Star
Explain Program

Sunday, April 13, 2025

C Program to Print Hollow Full Pyramid Using Stars Pattern

C Program to print Hollow Full pyramid star Pattern

C Program to Print Hollow Full Pyramid Using Stars Pattern



C Program to print Hollow Full pyramid star Pattern

Example :-


#include<stdio.h>
int main()

{
int i, space, row, star=0;


printf("Enter The Number ");
scanf("%d",&row);


for(i = 0; i < row-1; i++) {
for(space = 1; space < row-i; space++) {
printf(" ");
}


for (star = 0; star <= 2*i; star++) {
if(star==0 || star==2*i)


printf("*");
else
printf(" ");
}
printf("\n");
}


for(i=0; i<2*row-1; i++){
printf("*");


}
return 0;
}


C Program to Print Hollow Full Pyramid Using Stars Pattern

Explain Program

Step :1

#include <stdio.h>

int main()

{

    int i, space, row, star = 0;


#include <stdio.h> :-  printf and scanf.

 int i, space, row, star;: Declares loop variables and input variable.

 row = number of levels of the pyramid.

 i = controls outer loop (rows).

 space = manages indentation before the stars.

 star = controls how many positions are printed per row.