+ 2
How to output a Christmas tree using asterix (*), we should allowed to input the levels as well?
eg of an ouput using 3 levels * * * * * * * * * * * * * * * * * * *
2 Answers
+ 2
check this code might help
https://code.sololearn.com/cdGaa3zI5GFy/?ref=app
+ 1
something like
levels = user input
for (i=1; i<= levels;i++)
for (j=0; j<= i; j++)
output= " * " * (j+1);
cout<< /* padding code*/ << output<< endl;
this would be a c++ model. don't remember how to pad off the top of my head but that's the basic logic of it