diamond shape

closed account (ENyU7k9E)
how can we make a diamond shape by using nested loops only......??
Yes, if you search in the forums you may find some examples
The only thing you need is to understand the logic behind it
eg:
    *     4 spaces 1 star
   ***    3 spaces 3 stars
  *****   2 spaces 5 stars
 *******  1 space 7 stars
********* 9 stars
 *******  same as above
  *****
   ***
    *
closed account (ENyU7k9E)
but, program in the forum has used a funcion (printof)
and i want simple program simply by using nester loops. and in iostream library only
b/c i am new with programming
Last edited on
closed account (ENyU7k9E)
Thankyou so much brazzy.just tell me one thing what is the purpose and meaning of std::cout<<a;
cout << "something"
prints "something" on the console http://www.cplusplus.com/doc/tutorial/basic_io/
closed account (ENyU7k9E)
thanks bazzy!
i have got it....!!!
please help me i need only the out line..

*
* *
* *
* *
*
using loops and enter the amount of dots in a line.. i dunno how to start.. T.T
1
2
3
4
5
6
7
8
9
    *     4 spaces 1 star
   ***    3 spaces 3 stars
  *****   2 spaces 5 stars
 *******  1 space 7 stars
********* 0 spaces 9 stars
 *******  same as above
  *****
   ***
    *


well one loop could deal with spaces, the other could deal with stars ?
Start by making a triangle.
Topic archived. No new replies allowed.