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.
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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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.