CODING JOY

The stunning potpourri of coding and mundane life

SPLIT PYRAMID PATTERN IN C LANGUAGE



AMRUHA AHMED
10th October,2023.



This article will aid you in the creation of a split pyramid pattern in C language using a combination of nested loops.

blog1

DELVING DEEPER:

BREAK-UP OF THE PATTERN:

blog1

PROGRAM:

                
                    #include<stdio.h>
                    #include<stdlib.h>
                    void main()
                    {
                        int s=7;//number of spaces to be printed
                        int i,j;//loop counters
                        for(i=1;i<=7;i++)
                        {
                            for(j=1;j<=s;j++)
                            {
                                printf("  ");
                            }
                            for(j=1;j<=i;j++)
                            {
                                printf("* ");
                            }
                            printf(" ");
                            for(j=1;j<=i;j++)
                            {
                                printf("* ");
                            }
                            printf("\n");
                            s--;
                        }
                      
                        
                    }
                    
        
                    
             
         
CODE COPIED

OUTPUT:

blog1