Skip to content

Commit

Permalink
8th pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
ansiace authored Jan 10, 2025
1 parent 13dd6fa commit aa75e0b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Pattern8.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include<iostream>
using namespace std;
int main(){
int i = 4 , j = 7 ;
for( i = 1 ; i <= 4 ; i++ ){
int k = 1 ;
for( j = 1 ; j <= 7 ; j++ ){
if ( j>= 5-i && j <= 3+i ){
if( j < 4 ){
cout<<k;
k++;
}
else{
cout<<k;
k--;
}
}
else{
cout<<" ";
}
}
cout<<endl;
}
}

0 comments on commit aa75e0b

Please sign in to comment.