From a20d93cdf56793a124b7e9c954b048d9bfa69cd1 Mon Sep 17 00:00:00 2001 From: theabhishekgupta09 <111049326+theabhishekgupta09@users.noreply.github.com> Date: Sat, 15 Oct 2022 12:59:57 +0530 Subject: [PATCH] Create code for the patterns --- code for the patterns | 99 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 code for the patterns diff --git a/code for the patterns b/code for the patterns new file mode 100644 index 0000000..1383233 --- /dev/null +++ b/code for the patterns @@ -0,0 +1,99 @@ +//1 +//0 1 +//1 0 1 +//0 1 0 1 +//1 0 1 0 1 + + +int main(){ + int n; + cout<<"Enter the Limit : " ; + cin>>n; + for(int i=1 ; i<=n ; i++){ + for(int j=1 ; j<=i ; j++){ + if((i+j)%2==0){ + cout<<"1"<<" " ; + } else{ + cout<<"0"<<" " ; + } + } + cout<>n; + + for(int i=1 ; i<=n ; i++){ + for(int j=1 ; j<=i ; j++){ + cout<<"*" ; + } + cout<<"\n" ; + } + return 0; +} + + + +//0 +//1 2 +//3 4 5 +//6 7 8 9 +//10 11 12 13 14 + + +int main(){ + int n; + int num=0; + cout<<"Enter the Limit" ; + cin>>n; + for(int i =1 ; i<=n ; i++){ + for(int j=1 ; j>n; + + for(int i=1 ; i<=n ;i++){ + for(int j=1 ; j<=n-i ; j++){ + cout<<" "; + } + for(int j=i ; j>=1 ; j--){ + cout<