void main()
This has never ever been correct C++ and if your compiler accepts it, throw it away and get a C++ compiler.
<conio.h> is non-standard, <iostream.h> and <iomanip.h> are pre-standard and over a decade old. A C++ compiler that actually is a C++ compiler (that is, conforms to the C++ language definition) will have no idea what they are.
Seriously, where does all this 15 year old bad code keep coming from?
Moschops: I can find old books with a lot of things in it, that pre-date the 98 standard of c++. If you don't know the differences you might have problems. I can get turbo c++ 2.0 for free out there so I have been told. Open Watcom currently still has these libraries and they are all c++ compilers which haven't conformed to anything past 2k. As for the C++ 11 standard none of the compilers have completely supported it at last check.
BUT actually u used 3 for loop & an extra cout at the end to show tht exact result (but tht result was an example only)
first the program shud ask the total number of charecter...lets say it stor it in int total variable
in tht example i used 150 as total thts why it showed exactly 150 * (if u count)
but lets say total 10
then it will show
*
**
***
****
see it doesnt need to decreas at all, coz it didnt reach max number 10 (at last line char number was 4 only)
it will be decreasing after it makes a line with max number, say 10
& again when it becomes 1 & still not reached given total...so increase again, until total number of * printed
so it will print total of 150 charecter...lets say the charecter is *
first line it prints only 1 *
2nd line 2 *
& so on...
but as the n=10 given....it cannot print more than 10 * in a line. so it stop increasing at line 10.
from 11th line, it will be decresing...& again when it will only 1 star...it start increasing again
but whatever the situation, when it reach the total=150 number...it will stop printing & pause. (doesnt matter tht time it was increasing or decreasing or how many line it took to print all 150 *)
The number of people asking for code handouts on this site is ridiculous at the minute. Knowing the answer is a million miles away from knowing how to get the answer.