and i need to find two ways of receiving it. One by using one or two loops and the other needs to be with recursion.
i am a beginner with c++ and I can't think of anything useful.
-I would be really happy if someone could help me out a bit!
What do you mean by "receive"? A common beginner homework is to print shapes. Is that what you are trying to do?
This is a "loop" homework problem.
Notice that the middle row has seven zeros, and that it is also the seventh row.
Also notice that all the other rows before the middle row have the same number of zeros as the row number itself. (Row 1 has 1 zero; row 2 has 2 zeros, row 3 has 3 zeros, ...)
Think about this and how to do it with loops. You'll need two loops - one for the row, and one for the zeros.
I somehow managed to get the " image". unfortunatly only with the help of some class material. I copied the " for(;j;j--)" and dont understand what in particular it is doing. I would be very thankful i you could explain this to me :)
#include<iostream>
using namespace std;
void main()
{
int i,j,n;
cout<<"insert a number ";
cin>>n;
n=n+1;