X
XX
XXX
XXXX
XXXXX
but I want to print out:
X
XXX
XXXXX
XXXXXXX
here is the code I am using
int main()
{
for(int i=1; i<=5; i++)
{
for(int j=1; j <= i; j++)
{
cout << "X";
}
cout << endl;
}
cout << endl;
system("pause");
return 0;
}
I know this is very simple but I need a little hint.I have also googled this but I cant find a simple answer.