So the problem wants me to write code that gives me output like this:
0
*1
**2
***3
There is a Blank Space Here.
I keep getting the same output of:
0
*1
**2
***3
**** *Missing the space*
Here is my code:
#include <iostream>
using namespace std;
int main() {
int userNum = 0;
int i = 0;
int j = 0;
for(i = 0; i<= userNum; i++){
cout << i << endl << " " << "";
for (j=0; j< i; j++){
cout << " ";
}
}
return 0;
}
How do you add the blank space in?
Last edited on
Sorry guys. When I put my example in, I thought it would show the spaces.
So the output is suppose to be:
0
*1
**2
***3
*****
**Spaces*