Posts

Showing posts from April, 2025

c program to display alphabet pattern J with asterisk

Image
  C program 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 display alphabet pattern H with asterisk

Image
  C Program 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 ; } This C Program Print a pattern in the shape of the capital letter H using asterisks (*)  Explain Program Step :1 #include <stdio.h> standard input-output library use functions like printf(). Step :2 int main() The entry point of any C program. Returns an integer  Step :3 int...

c program to display alphabet pattern G with asterisk

Image
C Program 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 ))               ...

c program to display alphabet pattern F with asterisk

Image
 C Program 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 ( " " );         }      ...

c program to display alphabet pattern I with asterisk

Image
C program  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 (...

c program to display alphabet pattern E with asterisk

Image
  C program 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 ; } This C Program Print a pattern in the shape of the capital letter I using asterisks "*" Explain Program Step :1 #include <stdio.h> standard input/output library for function printf() and scanf( ) Step :2 int main() {   Start o...

c program to display alphabet pattern D with asterisk

Image
C Program 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 " );     }   ...