### How to loop chars (*)

Hey guys!

I am brand new to c++ programming and found a site on google: http://issc.uj.ac.za/appliedmaths/excpp.html for some beginner c++ exercises, i know this site has some too but i figured do them all :).

So im starting problem 1 and I know how to loop integers using the for loop but i dont know how to loop stuff like an asterisk (*) or characters. If anyone could help me out or lead me to a page that could help.

Thanks alot :)
When starting out with C++, you'll find out that your answer to your problems are actually a lot simpler than you think they are.

How you would do it would be like this:

 ``12345678910111213141516`` ``````int count = 1; // while count is 8 or lower while (count <= 8) { // send out the asterisks for (int i = 1; i <= count; i++) { cout << "*"; } // send out a new line cout << "\n"; // increase the count count++; }``````

There are many ways to answer to this solution, this is just one of the more simpler ones.
Durrr I didn't really read the original post so this isn't valid
Last edited on
Shadow Addict, no offense, but did you even check the link that he got this programming exercise from?

It said to create a program that gave this output:
 ``12345678`` ``````* ** *** **** ***** ****** ******* ********``````