program in C++ using nested loop that gives this output (star diamond)

Hi there This need to solve this question
Build a program in C++ using nested loop that gives this output (star diamond)



*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
*

Last edited on
Have you tried anything yourself?
NO sir I have no idea how to create this program
I Mean No idea about this program
closed account (48T7M4Gy)
http://www.cplusplus.com/forum/beginner/195411/
closed account (48T7M4Gy)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>

int main()
{
    std::cout << "*" << std::endl;
    std::cout << "* *" << std::endl;
    std::cout << "* * *" << std::endl;
    std::cout << "* * * *" << std::endl;
    std::cout << "* * * * *" << std::endl;
    std::cout << "* * * *" << std::endl;
    std::cout << "* * *" << std::endl;
    std::cout << "* *" << std::endl;
    std::cout << "* " << std::endl;  

   return 0;
}



*
* *
* * *
* * * *
* * * * *
* * * *
* * *
* *
* 
 
Exit code: 0 (normal program termination)
Last edited on
i nee nested loop
closed account (48T7M4Gy)
i nee (sic) nested loop

Don't we all? Our homework programmer team is rushing in to get started on this for you straight away, so stand by. In the mean time you could try: {lo{lo{loop}op}op};
Topic archived. No new replies allowed.