-
how to print this shape?
hi all,
i am new here..
and i need help..
when we print this shape
1
2 3
3 4 5
4 5 6 7
5 6 7 8 9
6 7 8 9 10 11
7 8 9 10 11 12 13
8 9 10 11 12 13 14 15
we print this program..
Code:
for(i=1;i<=8;i++)
{
k=i;
for(j=1;j<=i;j++)
{
cout<<k;
k++;
}
cout<<endl;
}
i have programed that
but when my teacher ask me this one
in this one i need help
1
5 3
6 4 5
7 5 6 7
8 6 7 8 9
7 8 9 10 11
8 9 10 11 12 13
9 10 11 12 13 14 15
please help me...
-
It's hard to tell what your second shape looks like unless you put it in code tags to keep the spaces accurate. Is this what you meant?
Code:
1
5 3
6 4 5
7 5 6 7
8 6 7 8 9
7 8 9 10 11
8 9 10 11 12 13
9 10 11 12 13 14 15
-
yes daved you can say that ..thank you
-
What have you tried so far? Or if you haven't started, what is your idea for solving that problem?
I don't understand the pattern of the picture, so I'm not sure I can tell you where to start.
-
i have tried to use if ..and no promise..and try to make it 2 shape and no results..