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<