Hi, I've just started learning C++ and I have a problem figuring out an assignment. It would be really great if someone could please help me. :icon_cheesygrin:
The program should look something like this:
Input number: 6
(then the program should read out following)
*
**
***
****
*****
******
This is what I've done so far:
(am I thinking right at all here? :icon_rolleyes:)
int _tmain(int argc, _TCHAR* argv[])
{
char teck='*';
int rep;
cout<<"Input number: ";
cin>>rep;
for(int z=0; z<=rep; z++)
cout<<char(teck)<<endl;
return 0;
}
But this only make the *'s line up, like this:
*
*
*
How do I get them to add an extra * on each line?