C Programming
C Programming

Butterfly Pattern Program

Butterfly Pattern Program

Butterfly Pattern Program

 

#include<stdio.h>
int main(){
    int n;
    scanf(“%d”,&n);
    for(int i=1;i<=n;i++){
        int empty=2*n-2*i;
        for(int j=1;j<=i;j++){
            printf(“*”);
        }
        for(int j=1;j<=empty;j++){
            printf(” “);
        }
        for(int j=1;j<=i;j++){
            printf(“*”);
        }
        printf(“\n”);
    }
    for(int i=n;i>=1;i–){
        int empty=2*n-2*i;
        for(int j=1;j<=i;j++){
            printf(“*”);
        }
        for(int j=1;j<=empty;j++){
            printf(” “);
        }
        for(int j=1;j<=i;j++){
            printf(“*”);
        }
        printf(“\n”);
    }
    return 0;
}

 


 

Topics Covered :

  • butterfly pattern
  • butterfly pattern in c
  • how to print pattern program in c
  • number pattern in c
  • pattern in c
  • important interview pattern
  • pyramid pattern
  • shape pattern in c

 

 


 

Thanks for reading this blog. Hope you get satisfied with the blog and definitely this blog must have valued your time and effort of reading.

Take a time to connect our other digital creations such as Instagram , Facebook and Youtube.

 

🧑‍💻🧑‍💻 Social Media Links of Tech DCode :

👉🏻 YouTube : https://www.youtube.com/channel/UCjJnEdeugftBwQ3yMuD4B_A
👉🏻 Instagram : https://www.instagram.com/thetechdcode/
👉🏻 Facebook Page : https://www.facebook.com/thetechdcode
👉🏻 Twitter : https://twitter.com/thetechdcode
👉🏻 Telegram Channel : https://t.me/thetechdcode
👉🏻 Tech DCode Linktree : https://linktr.ee/thetechdcode
👉🏻 My Personal Handles : https://linktr.ee/virtualshivamin

🧑‍💻🧑‍💻 Social Media Links of SHIVAM SINGH (OWNER) :

👉🏻 Instagram : https://www.instagram.com/virtualshivamin/
👉🏻 Facebook Page : https://www.facebook.com/virtualshivamin/
👉🏻 Twitter : https://twitter.com/virtualshivamin/
👉🏻 Personal Linktree : https://linktr.ee/virtualshivamin 

 

Leave a Reply

Your email address will not be published. Required fields are marked *