From 93975c165fe86167fed490be7111e05b7e32c4a6 Mon Sep 17 00:00:00 2001 From: Dilshad Alam <134841643+Dilshad-mohammad@users.noreply.github.com> Date: Wed, 30 Oct 2024 18:00:01 +0530 Subject: [PATCH] Create butterflypattern --- .../Patterns/butterfly/butterflypattern" | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 "Beginner Level \360\237\223\201/Patterns/butterfly/butterflypattern" diff --git "a/Beginner Level \360\237\223\201/Patterns/butterfly/butterflypattern" "b/Beginner Level \360\237\223\201/Patterns/butterfly/butterflypattern" new file mode 100644 index 00000000..00a78f83 --- /dev/null +++ "b/Beginner Level \360\237\223\201/Patterns/butterfly/butterflypattern" @@ -0,0 +1,36 @@ +#include +using namespace std; + +int main( ) +{ + int n; + cin>>n; + + for(int i=1;i<=n;i++){ + for(int j=1;j<=i;j++){ + cout<<"*"; + } + int space= 2*n - 2*i; + for( int j=1;j<=space;j++){ + cout<<" "; + } + for(int j=1;j<=i;j++){ + cout<<"*"; + } + cout<=1;i--){ + for(int j=1;j<=i;j++){ + cout<<"*"; + } + int space = 2*n - 2*i; + for( int k=1;k<=space;k++){ + cout<<" "; + } + for(int j=1;j<=i;j++){ + cout<<"*"; + } + cout<