#include
using namespace std;
int main()
{
for(int i=1;i<=4;i++)
{
int k=i;
for(int j=1;j<=7;j++)
{
if(j>=5-i&&j<=3+i){
cout<<k<<" ";
j<4?k++:k--;
}
else
cout<<" ";
}
cout<<"\n";
}
}
#include
using namespace std;
int main()
{
for(int i=1;i<=4;i++)
{
int k=i;
for(int j=1;j<=7;j++)
{
if(j>=5-i&&j<=3+i){
cout<<k<<" ";
j<4?k++:k--;
}
else
cout<<" ";
}
cout<<"\n";
}
}
hello @vrcoolbuddy08
it is mandatory to take input provided by system otherwise it will not give the expected output.
take input as per input format,write ur logic that works for given input and then submit
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.